Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 17.7k
Enable ruff PLW2101,PLW2901,PLW3301 rule#57700
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2a68f23
Enable ruff PLW2901 rule
jscheffl 1d8c4d9
Fix follow-up mypy complaints after PLW2901 rule
jscheffl 909d16f
Fix tests for pools and infinite size
jscheffl 66ba167
Fix logic in bigquery
jscheffl 0c88191
Fix variable renaming
jscheffl 1fc825e
Fix mypy alert
jscheffl 2b7ff08
Review feedback by Wei
jscheffl fdcef6b
Fix mypy
jscheffl 5c0e7ef
Revert accidentially deleted line
jscheffl 0eeea42
Second pass review suggestions by Wei
jscheffl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6 airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4 airflow-core/src/airflow/api_fastapi/core_api/services/public/pools.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6 airflow-core/src/airflow/api_fastapi/core_api/services/public/variables.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -365,30 +365,33 @@ def _register(): | ||
| _stringifiers.clear() | ||
| with Stats.timer("serde.load_serializers") as timer: | ||
| for _, name, _ in iter_namespace(airflow.serialization.serializers): | ||
| name = import_module(name) | ||
| for s in getattr(name, "serializers", ()): | ||
| if not isinstance(s, str): | ||
| s = qualname(s) | ||
| if s in _serializers and _serializers[s] != name: | ||
| raise AttributeError(f"duplicate {s} for serialization in {name} and {_serializers[s]}") | ||
| log.debug("registering %s for serialization", s) | ||
| _serializers[s] = name | ||
| for d in getattr(name, "deserializers", ()): | ||
| if not isinstance(d, str): | ||
| d = qualname(d) | ||
| if d in _deserializers and _deserializers[d] != name: | ||
| raise AttributeError(f"duplicate {d} for deserialization in {name} and {_serializers[d]}") | ||
| log.debug("registering %s for deserialization", d) | ||
| _deserializers[d] = name | ||
| _extra_allowed.add(d) | ||
| for c in getattr(name, "stringifiers", ()): | ||
| if not isinstance(c, str): | ||
| c = qualname(c) | ||
| if c in _deserializers and _deserializers[c] != name: | ||
| raise AttributeError(f"duplicate {c} for stringifiers in {name} and {_stringifiers[c]}") | ||
| log.debug("registering %s for stringifying", c) | ||
| _stringifiers[c] = name | ||
| for _, module_name, _ in iter_namespace(airflow.serialization.serializers): | ||
| module = import_module(module_name) | ||
| for serializers in getattr(module, "serializers", ()): | ||
| s_qualname = serializers if isinstance(serializers, str) else qualname(serializers) | ||
| if s_qualname in _serializers and _serializers[s_qualname] != module: | ||
| raise AttributeError( | ||
| f"duplicate {s_qualname} for serialization in {module} and {_serializers[s_qualname]}" | ||
| ) | ||
| log.debug("registering %s for serialization", s_qualname) | ||
| _serializers[s_qualname] = module | ||
| for deserializers in getattr(module, "deserializers", ()): | ||
| d_qualname = deserializers if isinstance(deserializers, str) else qualname(deserializers) | ||
| if d_qualname in _deserializers and _deserializers[d_qualname] != module: | ||
| raise AttributeError( | ||
| f"duplicate {d_qualname} for deserialization in {module} and {_deserializers[d_qualname]}" | ||
| ) | ||
| log.debug("registering %s for deserialization", d_qualname) | ||
| _deserializers[d_qualname] = module | ||
| _extra_allowed.add(d_qualname) | ||
| for stringifiers in getattr(module, "stringifiers", ()): | ||
jscheffl marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| c_qualname = stringifiers if isinstance(stringifiers, str) else qualname(stringifiers) | ||
| if c_qualname in _deserializers and _deserializers[c_qualname] != module: | ||
| raise AttributeError( | ||
| f"duplicate {c_qualname} for stringifiers in {module} and {_stringifiers[c_qualname]}" | ||
| ) | ||
| log.debug("registering %s for stringifying", c_qualname) | ||
| _stringifiers[c_qualname] = module | ||
| log.debug("loading serializers took %.3f seconds", timer.duration) | ||
15 changes: 9 additions & 6 deletions
15 airflow-core/src/airflow/serialization/serialized_objects.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6 airflow-core/tests/unit/cli/commands/test_connection_command.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6 dev/breeze/src/airflow_breeze/commands/release_management_commands.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.