Skip to content

UP037: autofix removes quotes from Literal["value"] typing when not imported #7025

@Prometheos2

Description

@Prometheos2

UP037's autofix removes quotes from typing.Literal["value"] when Literal is not imported, but it's supposed to have str values.

_DTYPE_BACKEND: Literal["pyarrow", "numpy_nullable"]

turns into

_DTYPE_BACKEND: Literal[pyarrow, numpy_nullable]

Details

  • Version: 0.0.286
  • Relevant settings: select = ["UP"]
  • Commands producing the bug:
    • the VSC extension's autofix
    • ruff . --fix
    • ruff . --fix --isolated --select UP

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-decisionAwaiting a decision from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions