-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timetable registration a la OperatorLinks #17931
Comments
The main reason I've previously gone down the "require classes the scheduler/webserver will load to require registration" is I have medium term plans to allow a dag definition to be submitted via an API (i.e. an Airflow user to post a JSON blob) -- and I don't want to open that up to allowing reverse-shell or similar by creating an instance of a random class. |
So it seems like method 1 is desired? I don’t think it technically changes the equation, but sounds like always requiring registration is the safest route. (Although it does make writing customised timtable more difficult since now you can only use pre-defined timetable classes instead of inventing things right inside a DAG file.) |
Since the scheduler needs to load the timetable class, and Airflow tries very hard to never load dag code in to a long running process, I think not being able to define it in a DAG file is, sadly, desired behaviour. You'd have to define it in a plugin which can live in |
Currently (as implemented in #17414), timetables are serialised by their classes’ full import path. This works most of the time, but not in some cases, including:
12345.py
)It’s fundamentally impossible to fix some of the cases (e.g. function-local class declaration) due to how Python works, but by requiring the user to explicitly register the timetable class, we can at least expose that problem so users don’t attempt to do that.
However, since the timetable actually would work a lot of times without any additional mechanism, I’m also wondering if we should require registration.
The text was updated successfully, but these errors were encountered: