-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Add back dag_run to docs #35142
Add back dag_run to docs #35142
Conversation
Are we want to make all methods of DagRun and DagRunNote as part of Airflow Public interface? |
The last time when we added all the other classes we relied on what have been already "intended" - i.e Do you think of some concrete methods that we should also mark as private in this case? Maybe that is a good opportunity to mark them as private indeed. |
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
i wish we could actually flip it and say everything is private unless explicitly declared public |
Difficult to say which one should be accessed in context and which one shouldn't. I assume that provide access to this methods to DAG Authors might be not a good idea. Some of them not documented, some of them could change behaviour of scheduled tasks airflow/airflow/models/dagrun.py Lines 644 to 646 in 1fdc231
airflow/airflow/models/dagrun.py Lines 1386 to 1398 in 1fdc231
airflow/airflow/models/dagrun.py Lines 857 to 866 in 1fdc231
airflow/airflow/models/dagrun.py Lines 807 to 810 in 1fdc231
airflow/airflow/models/dagrun.py Lines 272 to 273 in 1fdc231
|
That was the idea (on module level) to only include the modules we want (with the risk that we will not add something like dag_run initially - it's always OK to add something we forgot), But on member level it is not possible with autoapi, I am afraid https://sphinx-autoapi.readthedocs.io/en/latest/reference/config.html |
Yeah. The list might be a good start. |
@fritz-astronomer You should manually add DagRun toctree into the Public Interface of Airflow, some example: https://github.com/apache/airflow/pull/35032/files#diff-4c4bd448d0ce0ccad92e624513f28e532403582532f05fc4a53b0141e2f7acd7 |
Ideally we should provide some copy of DagRun (as well as others) into task context. Something like pydantic models which are use in internal API. But I think we can’t forced r/о context until:
|
This is actually one of the "soft" mechanism that AIP-44 aims to do. The DagRun | DagRunPydantic in BTW. In a way - AIP-44 will be a step towards this compatibility breaking if we decide to exclusively use Pydantic vs. DB object for the future (if any) Airlfow 3.0. When you will enable isolation in AIP-44, it will be "mostly" compatible for existing DAGs / custom operators etc. (that was the goal) but any direct |
I believe that this would prevent a some of non-obvious ways to break scheduler pipeline. That is not something new when DAG authors tried to change states in the middle of task execution or create some Airflow objects thought Models (and sessions when they found that code from SO doesn't work anymore). However right now better we could do it is hide methods/properties from Auto-API |
agree |
Adds in
dag_runs
so it can be linked to and viewed - such as from thetemplates.rst
page.Should others be here? Like
pool
? 🤷