-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
As part of the Airflow project we have an airflow.typing_compat
module that has this in it https://github.com/apache/airflow/blob/71306b31f1842ee2b1eb1cc2980b90f0fb6b11dc/airflow/typing_compat.py#L38-L41:
if sys.version_info >= (3, 9):
from typing import Literal
else:
from typing_extensions import Literal
Ruff right now doesn't detect this use of Literal and tries to resolve the value inside it as a type:
% echo 'from airflow.typing_compat import Literal; from typing import Union; X = Union[Literal[False], Literal["db"]]' | \
ruff - --line-length=999
-:1:104: F821 Undefined name `db`
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working