-
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
Remove :type
lines now sphinx-autoapi supports typehints
#20951
Conversation
HELL YEAH! BTW. I guess the main reason you did it is to finally reach negative net number of lines changed in Airflow ? |
I mean that was certainly part of the reason. A big part. It just happens to help that it's also the right thing to do 😁 |
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. |
Looks like some spelling errors (aka ClassNames) coming in via the types now need to be added to dictionary |
But images are ok, all tests pass and all looks good besides :) |
de76855
to
1149e63
Compare
Right, I think I've got all the type-induced spelling errors, unless one crept back in when rebasing 🤞🏻 |
2 errors left @ashb ! |
And conflicts with my cloud formation change :( |
Fixed the errors. Has your change merged? Ah, yes, conflicts already I see |
Since we have no updated sphinx-autoapi to a more recent version it supports showing type hints in the documentation, so we don't need to have the type hints _and_ the `:type` lines -- which is good, as the ones in the doc strings are easy to get out of date! The following settings have been set: `autodoc_typehints = 'description'` -- show types in description (where previous `:type` used to show up) `autodoc_typehints_description_target = 'documented'` -- only link to types that are documented. (Without this we have some missing return types that aren't documented, and aren't linked to in our current python API docs, so this caused a build failure) `autodoc_typehints_format = 'short'` -- Shorten type hints where possible, i.e. `StringIO` instead of `io.StringIO`
Now that we are using the type hints in the docs, sphinxcontrib-spelling picks them up as words to be checked, so we have to ignore them. I've chosen to add the provider specific ones to local dictionary files rather than the global, as for example, `mgmt` is an error in most places, but not in some of the Azure provider.
4685698
to
b3aec74
Compare
@potiuk Any idea what failed with the 'Constraints" job https://github.com/apache/airflow/runs/4888325400?check_suite_focus=true I don't actually see any error -- just some process exited with 1. (I thought we only ran that on main, not on PRs?) Ah, it's just the Push that only runs on main. That makes sense. |
Oh there's the error much futher up https://github.com/apache/airflow/runs/4888325400?check_suite_focus=true#step:7:580
Ummmm, yeah, something is wrong about constraint generation now, as it's trying to generate new constraints while using the old file?! |
Rebase ? |
Already up to date. |
Hmm. Will take a look in a bit |
We can merge the change now. The problem was because of one line missing in the latest refactor: |
BTW. This time the round number is mine ;) |
Thanks, I had a feeling it would be something like this but didn't want to break main if it was a bigger problem. |
Since we have no updated sphinx-autoapi to a more recent version it supports showing type hints in the documentation, so we don't need to have the type hints and the
:type
lines -- which is good, as the ones in the doc strings are easy to get out of date!The following settings have been set:
autodoc_typehints = 'description'
-- show types in description (where previous:type
used to show up)autodoc_typehints_description_target = 'documented'
-- only link to types that are documented. (Without this we have some missing return types that aren't documented, and aren't linked to in our current python API docs, so this caused a build failure)autodoc_typehints_format = 'short'
-- Shorten type hints where possible, i.e.StringIO
instead ofio.StringIO
Before (https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/baseoperator/index.html#airflow.models.baseoperator.BaseOperator)
After
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.