-
Notifications
You must be signed in to change notification settings - Fork 1.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
[chore] add UP rule to ruff and upgrade to Python 3.9 syntax #25703
base: master
Are you sure you want to change the base?
Conversation
Deploy preview for dagster-docs ready! Preview available at https://dagster-docs-5tw7rwtu0-elementl.vercel.app Direct link to changed pages: |
Deploy preview for dagster-docs-beta ready! Preview available at https://dagster-docs-beta-owcusk788-elementl.vercel.app Direct link to changed pages: |
I think this is great, and am in favor of inclusion of Will wait for approval from at least one other though to ensure consensus. |
Anyone wants to give another review? |
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.
Left a comment on the pyproject.toml.
Also this needs an internal companion PR to keep these OSS/internal in sync.
Otherwise nice!
After switching to
After running
Deprecated import errors are similar to:
Unused import errors look like:
I've added both rules to |
b7fba29
to
1cd51c5
Compare
With the above, we could also then announce this to end-headsup so people know what the have to "untrain" themselves from writing. |
1cd51c5
to
aa08de4
Compare
Hey @schrockn, I added violation stats to the PR description. For sure it's impossible to review, but the number of |
aa08de4
to
22d263f
Compare
Actually, there are some failures in BuildKite because some parts of it are still running on Python |
871b1b1
to
f5b563d
Compare
19ef526
to
11dabed
Compare
@schrockn @cmpadden @smackesey Hey guys, major tests seem to be passing. I would like to get an approval here because it's very hard to keep this PR up to date (new conflicts appear all the time). I'll rebase it again to make sure |
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.
What I want to see before we land this is the text of an announcement of this to eng-team that explains all changes here.
e.g.
* Use native types for list, dict, set in typing declarations. E.g. list[Foo] over List[Foo]. This reduces the number of imports for common use cases.
Then show a single example. Do this for all the rules.
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.
Requesting changes so that you can produce a team-facing document detailing all the changes.
11dabed
to
e8fb1ce
Compare
got it! |
Summary & Motivation
Hello, I really like running
ruff
on Dagster.This PR adds the pyupgrade rule which automatically updates Python syntax & usage to the minimal supported Python version (
3.9
in our case).The only exception is
dagster-buildkite
since it's still running on 3.8 (@gibsondan how hard would it be to bump Python in BuildKite?).See
pyproject.toml
diff:All other changes are automated.
Initial
UP
violations:Violations after
ruff check --fix
(before--unsafe-fixes
):And before ignoring the unfixable rules: