apache-airflow-providers-standard 0.0.3rc2__py3-none-any.whl → 1.0.0.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of apache-airflow-providers-standard might be problematic. Click here for more details.

Files changed (35) hide show
  1. airflow/providers/standard/__init__.py +1 -23
  2. airflow/providers/standard/get_provider_info.py +5 -52
  3. airflow/providers/standard/operators/datetime.py +2 -3
  4. airflow/providers/standard/operators/weekday.py +1 -4
  5. airflow/providers/standard/sensors/date_time.py +7 -27
  6. airflow/providers/standard/sensors/time.py +4 -23
  7. airflow/providers/standard/sensors/time_delta.py +4 -29
  8. airflow/providers/standard/sensors/weekday.py +1 -2
  9. {apache_airflow_providers_standard-0.0.3rc2.dist-info → apache_airflow_providers_standard-1.0.0.dev0.dist-info}/METADATA +17 -18
  10. apache_airflow_providers_standard-1.0.0.dev0.dist-info/RECORD +15 -0
  11. {apache_airflow_providers_standard-0.0.3rc2.dist-info → apache_airflow_providers_standard-1.0.0.dev0.dist-info}/WHEEL +1 -1
  12. airflow/providers/standard/hooks/__init__.py +0 -16
  13. airflow/providers/standard/hooks/filesystem.py +0 -89
  14. airflow/providers/standard/hooks/package_index.py +0 -95
  15. airflow/providers/standard/hooks/subprocess.py +0 -119
  16. airflow/providers/standard/operators/bash.py +0 -312
  17. airflow/providers/standard/operators/generic_transfer.py +0 -134
  18. airflow/providers/standard/operators/latest_only.py +0 -78
  19. airflow/providers/standard/operators/python.py +0 -1155
  20. airflow/providers/standard/operators/trigger_dagrun.py +0 -296
  21. airflow/providers/standard/sensors/bash.py +0 -116
  22. airflow/providers/standard/sensors/external_task.py +0 -512
  23. airflow/providers/standard/sensors/filesystem.py +0 -154
  24. airflow/providers/standard/sensors/python.py +0 -81
  25. airflow/providers/standard/triggers/__init__.py +0 -16
  26. airflow/providers/standard/triggers/external_task.py +0 -216
  27. airflow/providers/standard/triggers/file.py +0 -77
  28. airflow/providers/standard/triggers/temporal.py +0 -114
  29. airflow/providers/standard/utils/__init__.py +0 -16
  30. airflow/providers/standard/utils/python_virtualenv.py +0 -209
  31. airflow/providers/standard/utils/python_virtualenv_script.jinja2 +0 -101
  32. airflow/providers/standard/utils/sensor_helper.py +0 -123
  33. airflow/providers/standard/version_compat.py +0 -36
  34. apache_airflow_providers_standard-0.0.3rc2.dist-info/RECORD +0 -37
  35. {apache_airflow_providers_standard-0.0.3rc2.dist-info → apache_airflow_providers_standard-1.0.0.dev0.dist-info}/entry_points.txt +0 -0
@@ -1,78 +0,0 @@
1
- #
2
- # Licensed to the Apache Software Foundation (ASF) under one
3
- # or more contributor license agreements. See the NOTICE file
4
- # distributed with this work for additional information
5
- # regarding copyright ownership. The ASF licenses this file
6
- # to you under the Apache License, Version 2.0 (the
7
- # "License"); you may not use this file except in compliance
8
- # with the License. You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing,
13
- # software distributed under the License is distributed on an
14
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- # KIND, either express or implied. See the License for the
16
- # specific language governing permissions and limitations
17
- # under the License.
18
- """Contains an operator to run downstream tasks only for the latest scheduled DagRun."""
19
-
20
- from __future__ import annotations
21
-
22
- from collections.abc import Iterable
23
- from typing import TYPE_CHECKING
24
-
25
- import pendulum
26
-
27
- from airflow.operators.branch import BaseBranchOperator
28
-
29
- if TYPE_CHECKING:
30
- from airflow.models import DAG, DagRun
31
- from airflow.utils.context import Context
32
-
33
-
34
- class LatestOnlyOperator(BaseBranchOperator):
35
- """
36
- Skip tasks that are not running during the most recent schedule interval.
37
-
38
- If the task is run outside the latest schedule interval (i.e. external_trigger),
39
- all directly downstream tasks will be skipped.
40
-
41
- Note that downstream tasks are never skipped if the given DAG_Run is
42
- marked as externally triggered.
43
- """
44
-
45
- ui_color = "#e9ffdb" # nyanza
46
-
47
- def choose_branch(self, context: Context) -> str | Iterable[str]:
48
- # If the DAG Run is externally triggered, then return without
49
- # skipping downstream tasks
50
- dag_run: DagRun = context["dag_run"] # type: ignore[assignment]
51
- if dag_run.external_trigger:
52
- self.log.info("Externally triggered DAG_Run: allowing execution to proceed.")
53
- return list(context["task"].get_direct_relative_ids(upstream=False))
54
-
55
- dag: DAG = context["dag"]
56
- next_info = dag.next_dagrun_info(dag.get_run_data_interval(dag_run), restricted=False)
57
- now = pendulum.now("UTC")
58
-
59
- if next_info is None:
60
- self.log.info("Last scheduled execution: allowing execution to proceed.")
61
- return list(context["task"].get_direct_relative_ids(upstream=False))
62
-
63
- left_window, right_window = next_info.data_interval
64
- self.log.info(
65
- "Checking latest only with left_window: %s right_window: %s now: %s",
66
- left_window,
67
- right_window,
68
- now,
69
- )
70
-
71
- if not left_window < now <= right_window:
72
- self.log.info("Not latest execution, skipping downstream.")
73
- # we return an empty list, thus the parent BaseBranchOperator
74
- # won't exclude any downstream tasks from skipping.
75
- return []
76
- else:
77
- self.log.info("Latest, allowing execution to proceed.")
78
- return list(context["task"].get_direct_relative_ids(upstream=False))