Skip to content

add autofix for PYI030#7880

Merged
charliermarsh merged 4 commits intoastral-sh:mainfrom
diceroll123:PYI030-autofix
Oct 10, 2023
Merged

add autofix for PYI030#7880
charliermarsh merged 4 commits intoastral-sh:mainfrom
diceroll123:PYI030-autofix

Conversation

@diceroll123
Copy link
Copy Markdown
Contributor

Summary

Adds autofix to PYI030

Closes #7854.

Unsure if the cloning method I chose is the best solution here, feel free to suggest alternatives!

Test Plan

cargo test as well as manually

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 10, 2023

PR Check Results

Ecosystem

ℹ️ ecosystem check detected changes. (+6, -6, 0 error(s))

airflow (+4, -4)

- [*] 15842 fixable with the `--fix` option (6478 hidden fixes can be enabled with the `--unsafe-fixes` option).
+ [*] 15845 fixable with the `--fix` option (6478 hidden fixes can be enabled with the `--unsafe-fixes` option).
- airflow/cli/commands/task_command.py:80:21: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal[False, "db", "memory"]`
+ airflow/cli/commands/task_command.py:80:21: PYI030 [*] Multiple literal members in a union. Use a single literal, e.g. `Literal[False, "db", "memory"]`
- airflow/models/mappedoperator.py:85:20: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal["expand", "partial"]`
+ airflow/models/mappedoperator.py:85:20: PYI030 [*] Multiple literal members in a union. Use a single literal, e.g. `Literal["expand", "partial"]`
- airflow/providers_manager.py:195:24: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal["source", "package"]`
+ airflow/providers_manager.py:195:24: PYI030 [*] Multiple literal members in a union. Use a single literal, e.g. `Literal["source", "package"]`

bokeh (+2, -2)

- [*] 17725 fixable with the `--fix` option (4795 hidden fixes can be enabled with the `--unsafe-fixes` option).
+ [*] 17726 fixable with the `--fix` option (4795 hidden fixes can be enabled with the `--unsafe-fixes` option).
- src/bokeh/core/serialization.py:149:25: PYI030 Multiple literal members in a union. Use a single literal, e.g. `Literal["bool", "object"]`
+ src/bokeh/core/serialization.py:149:25: PYI030 [*] Multiple literal members in a union. Use a single literal, e.g. `Literal["bool", "object"]`

Rules changed: 1
Rule Changes Additions Removals
PYI030 8 4 4

@charliermarsh charliermarsh added the fixes Related to suggested fixes for violations label Oct 10, 2023
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thanks!

@charliermarsh charliermarsh enabled auto-merge (squash) October 10, 2023 03:06
@charliermarsh charliermarsh merged commit d8c0360 into astral-sh:main Oct 10, 2023
@jamesbraza
Copy link
Copy Markdown
Contributor

Thank you @diceroll123 and @charliermarsh!! 🥳

Comment on lines +178 to +179
31 |-field8: Literal[1] | (Literal[2] | str) # Error
31 |+field8: Literal[1, 2] # Error
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here expected Literal[1, 2] | str is the correct fix (?)

konstin pushed a commit that referenced this pull request Oct 11, 2023
## Summary

Adds autofix to `PYI030`

Closes #7854. 

Unsure if the cloning method I chose is the best solution here, feel
free to suggest alternatives!

## Test Plan

`cargo test` as well as manually
zanieb added a commit that referenced this pull request Oct 13, 2023
zanieb added a commit that referenced this pull request Oct 13, 2023
This reverts commit #7880 (d8c0360)
which does not perform the correct fix per
#7934
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes Related to suggested fixes for violations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: PYI030 autofix

4 participants