shahar1 commented on code in PR #51479:
URL: https://github.com/apache/airflow/pull/51479#discussion_r2132323293
##########
providers/standard/src/airflow/providers/standard/sensors/external_task.py:
##########
@@ -260,12 +260,13 @@ def __init__(
def _get_dttm_filter(self, context):
logical_date = context.get("logical_date")
- if logical_date is None:
- dag_run = context.get("dag_run")
- if TYPE_CHECKING:
- assert dag_run
+ if AIRFLOW_V_3_0_PLUS:
+ if logical_date is None:
+ dag_run = context.get("dag_run")
+ if TYPE_CHECKING:
+ assert dag_run
- logical_date = dag_run.run_after
+ logical_date = dag_run.run_after
Review Comment:
@kaxil @gopidesupavan This change was introduced in #48819.
The `run_after` parameter does not exist in Airflow v2, so it failed the
added unit test that runs with this version (i.e., it would probably won't run
at all in v2).
To fix it, I patched this function to ignore this `if` in v2 - effectively
making it as the [original
method](https://github.com/apache/airflow/blob/c16ad9846195adb0da181682813c44dbade55d47/airflow/sensors/external_task.py#L239).
I'd be happy for your review to see if it makes sense, thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]