uranusjr commented on code in PR #30706:
URL: https://github.com/apache/airflow/pull/30706#discussion_r1198508923
##########
airflow/timetables/base.py:
##########
@@ -122,11 +122,12 @@ class Timetable(Protocol):
like ``schedule=None`` and ``"@once"`` set it to *False*.
"""
- can_run: bool = True
- """Whether this timetable can actually schedule runs.
+ can_be_scheduled: bool = True
+ """Whether this timetable can actually schedule runs in an automated
manner.
- This defaults to and should generally be *True*, but ``NullTimetable`` sets
- this to *False*.
+ This defaults to and should generally be *True* (including non periodic
+ execution types like *@once* and data triggered tables), but
+ ``NullTimetable`` sets this to *False*.
"""
Review Comment:
I think the other way around is needed—since it’s Airflow that accesses the
value, and the user implements the timetable, we need to detect when
`can_be_scheduled` is accessed, and emit a warning when `can_run` is defined to
a different value.
It’d also probably be best to not use `__getattribute__` since the function
would be called on _every_ attribute access and slow down timetable access.
--
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]