-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Type-annotate SkipMixin and BaseXCom #20011
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
Conversation
|
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
2e7f84b to
8ad8f4b
Compare
|
Tests are failing with "Object of type bytes is not JSON serializable" on trying to send XCom over the API. |
airflow/models/xcom.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be causing docs to fail too, as it's somehow finding two places for all the methods on XCom.
(I'm guessing as to cause, doc build is failing though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine, the cause is actually the overloads:
WARNING: duplicate object description of airflow.models.xcom.BaseXCom.clear, other instance in _api/airflow/models/xcom/index, use :noindex: for one of them
File path: apache-airflow/_api/airflow/models/xcom/index.rst (215)
210 | .. classmethod:: clear(cls, execution_date: pendulum.DateTime, dag_id: str, task_id: str, session: Optional[Session] = None)
211 |
212 |
213 |
214 |
>215 | .. classmethod:: clear(cls, execution_date: Optional = None, dag_id: Optional = None, task_id: Optional = None, *, run_id: Optional = None, session: Session)
216 |
217 | Clears all XCom data from the database for the task instance
218 |
219 | ``run_id`` and ``execution_date`` are mutually exclusive.
I think generated by sphinx-autoapi. I’d expect it to support this years old feature; it’s very disappoiting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well actually it does support it since last year, but we’re pinning an extremely old version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every so often I've tried upgrading sphinx-autoapi, but last n times I tried there was a bug that meant it didn't build docs on a more recent version :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using autoapi in the first place? Do we have any non-Python APIs that can’t be documented with sphinx.ext.autodoc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Wow autoapi 1.0 is so fucking ancient even my workaround does not work. |
8ad8f4b to
dbc2769
Compare
|
I added a hack to allow manually telling AutoAPI to ignore any code construct if the docstring contains Note that I chose to document the desired interface that uses |
dbc2769 to
39c553b
Compare
a13121d to
8bc8127
Compare
|
I have just rebased this PR after the fix on main. |
Plus some minor fixups to make the entire file pass Mypy.
This patch makes Sphinx-AutoAPI to skip anything if its docstring contains ':sphinx-autoapi-skip:' (no quotes, surrounded by whitespaces).
8bc8127 to
9057f74
Compare
|
Rebasing (again) to hopefully fix the last of test failures. |
|
✅ 🎉 |
(cherry picked from commit 6dd0a0d)
(cherry picked from commit 6dd0a0d)
(cherry picked from commit 6dd0a0d)
Extracted from #19825, these are required to make Mypy pass checking the two files.