uranusjr commented on code in PR #66303:
URL: https://github.com/apache/airflow/pull/66303#discussion_r3179516530
##########
airflow-core/src/airflow/example_dags/plugins/workday.py:
##########
@@ -33,17 +33,24 @@
from airflow.timetables.base import TimeRestriction
log = logging.getLogger(__name__)
-try:
- from pandas.tseries.holiday import USFederalHolidayCalendar
-
- holiday_calendar = USFederalHolidayCalendar()
-except ImportError:
- log.warning("Could not import pandas. Holidays will not be considered.")
- holiday_calendar = None # type: ignore[assignment]
class AfterWorkdayTimetable(Timetable):
+ _holiday_calendar = None
Review Comment:
It’s not that big a deal in practice since the function is called
essentially once every time the timetable is loaded in either case due to how
Airflow works. But I agree having a way to distinguish between not-loaded and
loading-failed is a good idea.
--
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]