henry3260 commented on code in PR #66303:
URL: https://github.com/apache/airflow/pull/66303#discussion_r3178557360


##########
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:
   If pandas is not installed, the current logic will attempt to import and 
catch the `ImportError `every time `_get_holiday_calendar `is called because 
`_holiday_calendar `remains None.
   
   Could we distinguish between not yet initialized and initialization failed? 
wdyt



-- 
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]

Reply via email to