Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix output property missing for airflow version < 2.4.0 #1385

Merged
merged 14 commits into from
Dec 12, 2022
Merged
9 changes: 8 additions & 1 deletion python-sdk/src/astro/sql/operators/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,14 @@ def resolve_tables_from_tasks( # noqa: C901
and isinstance(task, MappedOperator)
and issubclass(task.operator_class, OPERATOR_CLASSES_WITH_TABLE_OUTPUT)
):
for t in task.output.resolve(context):
from airflow.models.xcom_arg import XComArg

try:
task_output = task.output
except AttributeError:
task_output = XComArg(operator=task)

for t in task_output.resolve(context):
if isinstance(t, BaseTable):
res.append(t)
except AirflowException: # pragma: no cover
Expand Down