Skip to content

Conversation

@uranusjr
Copy link
Member

@uranusjr uranusjr commented Nov 25, 2025

For built-in timetables, the SDK only contain minimal stubs that implement the arguments (mostly attrs-generated), and validate() (called when a DAG instance is created). Serialization logic is moved to airflow.serialization.encoders. When the dag processor sees those SDK stubs, it converts the import path to Core timetable classes, which implement most of the actual logic once deserialized.

User-custom timetables should still inherit airflow.timetables.Timetable because they must be defined in plugins and loaded into protected processes.

A part of #52141.

@boring-cyborg boring-cyborg bot added area:dev-tools area:serialization area:task-sdk backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Nov 25, 2025
@uranusjr uranusjr removed the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Nov 25, 2025
@uranusjr uranusjr force-pushed the timetable-serialization branch 9 times, most recently from 16d1d9d to b7610a9 Compare December 1, 2025 06:19
@uranusjr uranusjr force-pushed the timetable-serialization branch 3 times, most recently from 4f5a04e to f35fa74 Compare December 1, 2025 10:02
@uranusjr uranusjr marked this pull request as ready for review December 1, 2025 10:02
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little worried we might need some back-compat on the imports, but I'm not really sure if that is true or not. BaseTime table probably needs one for anyone who might have created a custom timetable.

For instance a custom timetable did this:

from airflow.timetables.base import DagRunInfo, DataInterval, TimeRestriction, Timetable

@uranusjr
Copy link
Member Author

uranusjr commented Dec 3, 2025

The current (before this PR) way to use custom timetables is to import the base class in core, and that still exists (it’s still the base class for all timetable classes in core), so I don’t think anything would break. You can swith to the new base class in SDK, but things will also continue to work if you don’t change anything.

@uranusjr uranusjr force-pushed the timetable-serialization branch from b0536e7 to 5eab691 Compare December 3, 2025 09:03
@uranusjr uranusjr merged commit f3af770 into apache:main Dec 3, 2025
119 checks passed
@uranusjr uranusjr deleted the timetable-serialization branch December 3, 2025 10:00
itayweb pushed a commit to itayweb/airflow that referenced this pull request Dec 6, 2025
Copy link
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#protm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants