Skip to content

D205 Support - Models#32575

Merged
potiuk merged 4 commits into
apache:mainfrom
aws-mwaa:ferruzzi/pydocstyle-205/models
Jul 19, 2023
Merged

D205 Support - Models#32575
potiuk merged 4 commits into
apache:mainfrom
aws-mwaa:ferruzzi/pydocstyle-205/models

Conversation

@ferruzzi

Copy link
Copy Markdown
Contributor

Part of #10742

D205 asserts that all docstrings must have a one-line summary ending in a period. If there is more than one sentence then there must be a blank line before the rest of the docstring. Meeting these requirements could be as simple as adding a newline, or might require some rephrasing.

There are almost a thousand violations in the repo so we're going to have to take this in bites.

PLEASE NOTE

There should be zero changes to any functional logic or type hinting in this PR, only changes to docstrings and whitespace. If you see otherwise, please call it out.

Included in this chunk

All files in the airflow/models module.

To test

If you comment out this line and run pre-commit in main you will get 250 errors. After these changes, "only" 147 remain and no files in theairflow/models folder should be on the list. After uncommenting that line and rerunning pre-commits, there should be zero regressions.

Comment thread airflow/models/baseoperator.py Outdated
Comment thread airflow/models/baseoperator.py Outdated
Comment thread airflow/models/baseoperator.py Outdated
@ferruzzi

Copy link
Copy Markdown
Contributor Author

@uranusjr - Could you have another look when you get time?

Comment thread airflow/models/dag.py
Comment on lines 3319 to 3322
class DagOwnerAttributes(Base):
"""Table defining different owner attributes.
"""
Table defining different owner attributes.

For example, a link for an owner that will be passed as a hyperlink to the
"DAGs" view.
For example, a link for an owner that will be passed as a hyperlink to the "DAGs" view.
"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does this change? The previous string looks fine to me

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ruff didn't like the summary sentence being one the same line as the triple-quotes (old line 3319 becomes new line 3318L:3319) an I removed the line break on old line 3321 (old lines 3321:3322 becomes new line 3321) since the string fits on one line fine..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

without the awkward git diff display, this:

"""Table defining different owner attributes.

For example, a link for an owner that will be passed as a hyperlink to the
"DAGs" view.
"""

changes to this:

"""
Table defining different owner attributes.

For example, a link for an owner that will be passed as a hyperlink to the "DAGs" view.
"""

@potiuk
potiuk merged commit 9d7c224 into apache:main Jul 19, 2023
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Aug 2, 2023
@ephraimbuddy ephraimbuddy added this to the Airflow 2.7.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:serialization area:Triggerer type:misc/internal Changelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants