Skip to content
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

Deduplicate type hints #27508

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def expand_env_var(env_var: str) -> str:
...


def expand_env_var(env_var: str | None) -> str | None | None:
def expand_env_var(env_var: str | None) -> str | None:
"""
Expands (potentially nested) env vars by repeatedly applying
`expandvars` and `expanduser` until interpolation stops having
Expand Down
2 changes: 1 addition & 1 deletion airflow/decorators/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class TaskDecoratorCollection:
shm_size: int | None = None,
tty: bool = False,
privileged: bool = False,
cap_add: str | None | None = None,
cap_add: str | None = None,
extra_hosts: dict[str, str] | None = None,
**kwargs,
) -> TaskDecorator:
Expand Down
4 changes: 2 additions & 2 deletions airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,12 +1261,12 @@ def concurrency_reached(self):
return self.get_concurrency_reached()

@provide_session
def get_is_active(self, session=NEW_SESSION) -> None | None:
def get_is_active(self, session=NEW_SESSION) -> None:
"""Returns a boolean indicating whether this DAG is active"""
return session.query(DagModel.is_active).filter(DagModel.dag_id == self.dag_id).scalar()

@provide_session
def get_is_paused(self, session=NEW_SESSION) -> None | None:
def get_is_paused(self, session=NEW_SESSION) -> None:
"""Returns a boolean indicating whether this DAG is paused"""
return session.query(DagModel.is_paused).filter(DagModel.dag_id == self.dag_id).scalar()

Expand Down