Skip to content

Commit

Permalink
Reduce airflow.datasets import footprint
Browse files Browse the repository at this point in the history
We don't need ProvidersManager until very late in the runtime, so a lazy
import removes a ton of overhead for many cases.
  • Loading branch information
uranusjr committed Jan 31, 2024
1 parent a7f0ec4 commit e70f323
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions airflow/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

import attr

from airflow.providers_manager import ProvidersManager

if TYPE_CHECKING:
from urllib.parse import SplitResult

Expand All @@ -36,6 +34,8 @@ def normalize_noop(parts: SplitResult) -> SplitResult:
def _get_uri_normalizer(scheme: str) -> Callable[[SplitResult], SplitResult] | None:
if scheme == "file":
return normalize_noop
from airflow.providers_manager import ProvidersManager

return ProvidersManager().dataset_uri_handlers.get(scheme)


Expand Down

0 comments on commit e70f323

Please sign in to comment.