Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
from collections.abc import Iterable


def return_single_query_results(sql: str | Iterable[str], return_last: bool, split_statements: bool | None):
def return_single_query_results(
sql: str | Iterable[str], return_last: bool, split_statements: bool | None
) -> bool:
"""
Determine when results of single query only should be returned.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
be removed in the future. Please import it from 'airflow.providers.common.sql.hooks.handlers'."""


def return_single_query_results(sql: str | Iterable[str], return_last: bool, split_statements: bool | None):
def return_single_query_results(
sql: str | Iterable[str], return_last: bool, split_statements: bool | None
) -> bool:
warnings.warn(WARNING_MESSAGE.format("return_single_query_results"), DeprecationWarning, stacklevel=2)

return handlers.return_single_query_results(sql, return_last, split_statements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from airflow.hooks.base import BaseHook


def _get_field(extras: dict, field_name: str):
def _get_field(extras: dict, field_name: str) -> str | None:
"""Get field from extra, first checking short name, then for backcompat we check for prefixed name."""
backcompat_prefix = "extra__dataprep__"
if field_name.startswith("extra__"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(self):
RT = TypeVar("RT")


def get_field(extras: dict, field_name: str):
def get_field(extras: dict, field_name: str) -> str | None:
"""Get field from extra, first checking short name, then for backcompat we check for prefixed name."""
if field_name.startswith("extra__"):
raise ValueError(
Expand Down