uranusjr commented on a change in pull request #22501:
URL: https://github.com/apache/airflow/pull/22501#discussion_r834246295
##########
File path: airflow/providers/google/cloud/operators/gcs.py
##########
@@ -740,19 +740,19 @@ def execute(self, context: "Context") -> List[str]:
try:
timespan_start = context["data_interval_start"]
timespan_end = context["data_interval_end"]
- except KeyError: # Data interval context variables are only available
in Airflow 2.2+
- timespan_start =
timezone.coerce_datetime(context["execution_date"])
- timespan_end =
timezone.coerce_datetime(context["dag"].following_schedule(timespan_start))
+ except KeyError:
+ timespan_start = context["execution_date"]
Review comment:
Yes I think we should. Since `context["execution_date"]` can never be
None, this can simply use `pendulum.instance`. The `following_schedule()` one
below needs an additional check because it _can_ be None.
--
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]