apache-airflow-providers-standard 0.1.0rc1__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.
- airflow/providers/standard/LICENSE +52 -0
- airflow/providers/standard/__init__.py +1 -23
- airflow/providers/standard/get_provider_info.py +7 -54
- airflow/providers/standard/operators/datetime.py +3 -8
- airflow/providers/standard/operators/weekday.py +4 -11
- airflow/providers/standard/sensors/date_time.py +8 -32
- airflow/providers/standard/sensors/time.py +5 -28
- airflow/providers/standard/sensors/time_delta.py +10 -48
- airflow/providers/standard/sensors/weekday.py +2 -7
- {apache_airflow_providers_standard-0.1.0rc1.dist-info → apache_airflow_providers_standard-1.0.0.dev0.dist-info}/METADATA +36 -20
- apache_airflow_providers_standard-1.0.0.dev0.dist-info/RECORD +15 -0
- {apache_airflow_providers_standard-0.1.0rc1.dist-info → apache_airflow_providers_standard-1.0.0.dev0.dist-info}/WHEEL +1 -1
- airflow/providers/standard/hooks/__init__.py +0 -16
- airflow/providers/standard/hooks/filesystem.py +0 -89
- airflow/providers/standard/hooks/package_index.py +0 -95
- airflow/providers/standard/hooks/subprocess.py +0 -119
- airflow/providers/standard/operators/bash.py +0 -310
- airflow/providers/standard/operators/empty.py +0 -39
- airflow/providers/standard/operators/generic_transfer.py +0 -138
- airflow/providers/standard/operators/latest_only.py +0 -83
- airflow/providers/standard/operators/python.py +0 -1132
- airflow/providers/standard/operators/trigger_dagrun.py +0 -292
- airflow/providers/standard/sensors/bash.py +0 -120
- airflow/providers/standard/sensors/external_task.py +0 -509
- airflow/providers/standard/sensors/filesystem.py +0 -158
- airflow/providers/standard/sensors/python.py +0 -85
- airflow/providers/standard/triggers/__init__.py +0 -16
- airflow/providers/standard/triggers/external_task.py +0 -211
- airflow/providers/standard/triggers/file.py +0 -131
- airflow/providers/standard/triggers/temporal.py +0 -114
- airflow/providers/standard/utils/__init__.py +0 -16
- airflow/providers/standard/utils/python_virtualenv.py +0 -209
- airflow/providers/standard/utils/python_virtualenv_script.jinja2 +0 -77
- airflow/providers/standard/utils/sensor_helper.py +0 -119
- airflow/providers/standard/version_compat.py +0 -36
- apache_airflow_providers_standard-0.1.0rc1.dist-info/RECORD +0 -38
- {apache_airflow_providers_standard-0.1.0rc1.dist-info → apache_airflow_providers_standard-1.0.0.dev0.dist-info}/entry_points.txt +0 -0
|
@@ -199,3 +199,55 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
199
199
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
200
|
See the License for the specific language governing permissions and
|
|
201
201
|
limitations under the License.
|
|
202
|
+
|
|
203
|
+
============================================================================
|
|
204
|
+
APACHE AIRFLOW SUBCOMPONENTS:
|
|
205
|
+
|
|
206
|
+
The Apache Airflow project contains subcomponents with separate copyright
|
|
207
|
+
notices and license terms. Your use of the source code for the these
|
|
208
|
+
subcomponents is subject to the terms and conditions of the following
|
|
209
|
+
licenses.
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
========================================================================
|
|
213
|
+
Third party Apache 2.0 licenses
|
|
214
|
+
========================================================================
|
|
215
|
+
|
|
216
|
+
The following components are provided under the Apache 2.0 License.
|
|
217
|
+
See project link for details. The text of each license is also included
|
|
218
|
+
at 3rd-party-licenses/LICENSE-[project].txt.
|
|
219
|
+
|
|
220
|
+
(ALv2 License) hue v4.3.0 (https://github.com/cloudera/hue/)
|
|
221
|
+
(ALv2 License) jqclock v2.3.0 (https://github.com/JohnRDOrazio/jQuery-Clock-Plugin)
|
|
222
|
+
(ALv2 License) bootstrap3-typeahead v4.0.2 (https://github.com/bassjobsen/Bootstrap-3-Typeahead)
|
|
223
|
+
(ALv2 License) connexion v2.7.0 (https://github.com/zalando/connexion)
|
|
224
|
+
|
|
225
|
+
========================================================================
|
|
226
|
+
MIT licenses
|
|
227
|
+
========================================================================
|
|
228
|
+
|
|
229
|
+
The following components are provided under the MIT License. See project link for details.
|
|
230
|
+
The text of each license is also included at 3rd-party-licenses/LICENSE-[project].txt.
|
|
231
|
+
|
|
232
|
+
(MIT License) jquery v3.5.1 (https://jquery.org/license/)
|
|
233
|
+
(MIT License) dagre-d3 v0.6.4 (https://github.com/cpettitt/dagre-d3)
|
|
234
|
+
(MIT License) bootstrap v3.4.1 (https://github.com/twbs/bootstrap/)
|
|
235
|
+
(MIT License) d3-tip v0.9.1 (https://github.com/Caged/d3-tip)
|
|
236
|
+
(MIT License) dataTables v1.10.25 (https://datatables.net)
|
|
237
|
+
(MIT License) normalize.css v3.0.2 (http://necolas.github.io/normalize.css/)
|
|
238
|
+
(MIT License) ElasticMock v1.3.2 (https://github.com/vrcmarcos/elasticmock)
|
|
239
|
+
(MIT License) MomentJS v2.24.0 (http://momentjs.com/)
|
|
240
|
+
(MIT License) eonasdan-bootstrap-datetimepicker v4.17.49 (https://github.com/eonasdan/bootstrap-datetimepicker/)
|
|
241
|
+
|
|
242
|
+
========================================================================
|
|
243
|
+
BSD 3-Clause licenses
|
|
244
|
+
========================================================================
|
|
245
|
+
The following components are provided under the BSD 3-Clause license. See project links for details.
|
|
246
|
+
The text of each license is also included at 3rd-party-licenses/LICENSE-[project].txt.
|
|
247
|
+
|
|
248
|
+
(BSD 3 License) d3 v5.16.0 (https://d3js.org)
|
|
249
|
+
(BSD 3 License) d3-shape v2.1.0 (https://github.com/d3/d3-shape)
|
|
250
|
+
(BSD 3 License) cgroupspy 0.2.1 (https://github.com/cloudsigma/cgroupspy)
|
|
251
|
+
|
|
252
|
+
========================================================================
|
|
253
|
+
See 3rd-party-licenses/LICENSES-ui.txt for packages used in `/airflow/www`
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#
|
|
1
2
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
3
|
# or more contributor license agreements. See the NOTICE file
|
|
3
4
|
# distributed with this work for additional information
|
|
@@ -14,26 +15,3 @@
|
|
|
14
15
|
# KIND, either express or implied. See the License for the
|
|
15
16
|
# specific language governing permissions and limitations
|
|
16
17
|
# under the License.
|
|
17
|
-
#
|
|
18
|
-
# NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
|
|
19
|
-
# OVERWRITTEN WHEN PREPARING DOCUMENTATION FOR THE PACKAGES.
|
|
20
|
-
#
|
|
21
|
-
# IF YOU WANT TO MODIFY THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
|
|
22
|
-
# `PROVIDER__INIT__PY_TEMPLATE.py.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
|
|
23
|
-
#
|
|
24
|
-
from __future__ import annotations
|
|
25
|
-
|
|
26
|
-
import packaging.version
|
|
27
|
-
|
|
28
|
-
from airflow import __version__ as airflow_version
|
|
29
|
-
|
|
30
|
-
__all__ = ["__version__"]
|
|
31
|
-
|
|
32
|
-
__version__ = "0.1.0"
|
|
33
|
-
|
|
34
|
-
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
35
|
-
"2.9.0"
|
|
36
|
-
):
|
|
37
|
-
raise RuntimeError(
|
|
38
|
-
f"The package `apache-airflow-providers-standard:{__version__}` needs Apache Airflow 2.9.0+"
|
|
39
|
-
)
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
# NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
|
|
18
|
+
# NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
|
|
19
|
+
# OVERWRITTEN WHEN PREPARING PACKAGES.
|
|
19
20
|
#
|
|
20
21
|
# IF YOU WANT TO MODIFY THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
|
|
21
22
|
# `get_provider_info_TEMPLATE.py.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
|
|
@@ -26,19 +27,16 @@ def get_provider_info():
|
|
|
26
27
|
"package-name": "apache-airflow-providers-standard",
|
|
27
28
|
"name": "Standard",
|
|
28
29
|
"description": "Airflow Standard Provider\n",
|
|
29
|
-
"state": "ready",
|
|
30
|
-
"source-date-epoch":
|
|
31
|
-
"versions": ["
|
|
30
|
+
"state": "not-ready",
|
|
31
|
+
"source-date-epoch": 1718603992,
|
|
32
|
+
"versions": ["1.0.0"],
|
|
33
|
+
"dependencies": ["apache-airflow>=2.10.0"],
|
|
32
34
|
"integrations": [
|
|
33
35
|
{
|
|
34
36
|
"integration-name": "Standard",
|
|
35
37
|
"external-doc-url": "https://airflow.apache.org/",
|
|
36
38
|
"tags": ["apache"],
|
|
37
|
-
"how-to-guide": [
|
|
38
|
-
"/docs/apache-airflow-providers-standard/operators/bash.rst",
|
|
39
|
-
"/docs/apache-airflow-providers-standard/operators/python.rst",
|
|
40
|
-
"/docs/apache-airflow-providers-standard/operators/datetime.rst",
|
|
41
|
-
],
|
|
39
|
+
"how-to-guide": ["/docs/apache-airflow-providers-standard/operators.rst"],
|
|
42
40
|
}
|
|
43
41
|
],
|
|
44
42
|
"operators": [
|
|
@@ -47,12 +45,6 @@ def get_provider_info():
|
|
|
47
45
|
"python-modules": [
|
|
48
46
|
"airflow.providers.standard.operators.datetime",
|
|
49
47
|
"airflow.providers.standard.operators.weekday",
|
|
50
|
-
"airflow.providers.standard.operators.bash",
|
|
51
|
-
"airflow.providers.standard.operators.python",
|
|
52
|
-
"airflow.providers.standard.operators.empty",
|
|
53
|
-
"airflow.providers.standard.operators.generic_transfer",
|
|
54
|
-
"airflow.providers.standard.operators.trigger_dagrun",
|
|
55
|
-
"airflow.providers.standard.operators.latest_only",
|
|
56
48
|
],
|
|
57
49
|
}
|
|
58
50
|
],
|
|
@@ -64,46 +56,7 @@ def get_provider_info():
|
|
|
64
56
|
"airflow.providers.standard.sensors.time_delta",
|
|
65
57
|
"airflow.providers.standard.sensors.time",
|
|
66
58
|
"airflow.providers.standard.sensors.weekday",
|
|
67
|
-
"airflow.providers.standard.sensors.bash",
|
|
68
|
-
"airflow.providers.standard.sensors.python",
|
|
69
|
-
"airflow.providers.standard.sensors.filesystem",
|
|
70
|
-
"airflow.providers.standard.sensors.external_task",
|
|
71
|
-
],
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
|
-
"hooks": [
|
|
75
|
-
{
|
|
76
|
-
"integration-name": "Standard",
|
|
77
|
-
"python-modules": [
|
|
78
|
-
"airflow.providers.standard.hooks.filesystem",
|
|
79
|
-
"airflow.providers.standard.hooks.package_index",
|
|
80
|
-
"airflow.providers.standard.hooks.subprocess",
|
|
81
59
|
],
|
|
82
60
|
}
|
|
83
61
|
],
|
|
84
|
-
"triggers": [
|
|
85
|
-
{
|
|
86
|
-
"integration-name": "Standard",
|
|
87
|
-
"python-modules": [
|
|
88
|
-
"airflow.providers.standard.triggers.external_task",
|
|
89
|
-
"airflow.providers.standard.triggers.file",
|
|
90
|
-
"airflow.providers.standard.triggers.temporal",
|
|
91
|
-
],
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
"config": {
|
|
95
|
-
"standard": {
|
|
96
|
-
"description": "Options for the standard provider operators.",
|
|
97
|
-
"options": {
|
|
98
|
-
"venv_install_method": {
|
|
99
|
-
"description": "Which python tooling should be used to install the virtual environment.\n\nThe following options are available:\n- ``auto``: Automatically select, use ``uv`` if available, otherwise use ``pip``.\n- ``pip``: Use pip to install the virtual environment.\n- ``uv``: Use uv to install the virtual environment. Must be available in environment PATH.\n",
|
|
100
|
-
"version_added": None,
|
|
101
|
-
"type": "string",
|
|
102
|
-
"example": "uv",
|
|
103
|
-
"default": "auto",
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
"dependencies": ["apache-airflow>=2.9.0", "apache-airflow-providers-common-sql>=1.20.0"],
|
|
109
62
|
}
|
|
@@ -17,19 +17,14 @@
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
19
|
import datetime
|
|
20
|
-
from
|
|
21
|
-
from typing import TYPE_CHECKING
|
|
20
|
+
from typing import TYPE_CHECKING, Iterable
|
|
22
21
|
|
|
23
22
|
from airflow.exceptions import AirflowException
|
|
24
23
|
from airflow.operators.branch import BaseBranchOperator
|
|
25
24
|
from airflow.utils import timezone
|
|
26
25
|
|
|
27
26
|
if TYPE_CHECKING:
|
|
28
|
-
|
|
29
|
-
from airflow.sdk.definitions.context import Context
|
|
30
|
-
except ImportError:
|
|
31
|
-
# TODO: Remove once provider drops support for Airflow 2
|
|
32
|
-
from airflow.utils.context import Context
|
|
27
|
+
from airflow.utils.context import Context
|
|
33
28
|
|
|
34
29
|
|
|
35
30
|
class BranchDateTimeOperator(BaseBranchOperator):
|
|
@@ -49,7 +44,7 @@ class BranchDateTimeOperator(BaseBranchOperator):
|
|
|
49
44
|
:param target_lower: target lower bound.
|
|
50
45
|
:param target_upper: target upper bound.
|
|
51
46
|
:param use_task_logical_date: If ``True``, uses task's logical date to compare with targets.
|
|
52
|
-
|
|
47
|
+
Execution date is useful for backfilling. If ``False``, uses system's date.
|
|
53
48
|
"""
|
|
54
49
|
|
|
55
50
|
def __init__(
|
|
@@ -17,19 +17,14 @@
|
|
|
17
17
|
# under the License.
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from typing import TYPE_CHECKING
|
|
20
|
+
from typing import TYPE_CHECKING, Iterable
|
|
22
21
|
|
|
23
22
|
from airflow.operators.branch import BaseBranchOperator
|
|
24
23
|
from airflow.utils import timezone
|
|
25
24
|
from airflow.utils.weekday import WeekDay
|
|
26
25
|
|
|
27
26
|
if TYPE_CHECKING:
|
|
28
|
-
|
|
29
|
-
from airflow.sdk.definitions.context import Context
|
|
30
|
-
except ImportError:
|
|
31
|
-
# TODO: Remove once provider drops support for Airflow 2
|
|
32
|
-
from airflow.utils.context import Context
|
|
27
|
+
from airflow.utils.context import Context
|
|
33
28
|
|
|
34
29
|
|
|
35
30
|
class BranchDayOfWeekOperator(BaseBranchOperator):
|
|
@@ -43,8 +38,7 @@ class BranchDayOfWeekOperator(BaseBranchOperator):
|
|
|
43
38
|
|
|
44
39
|
.. code-block:: python
|
|
45
40
|
|
|
46
|
-
from airflow.
|
|
47
|
-
from airflow.operators.weekday import BranchDayOfWeekOperator
|
|
41
|
+
from airflow.operators.empty import EmptyOperator
|
|
48
42
|
|
|
49
43
|
monday = EmptyOperator(task_id="monday")
|
|
50
44
|
other_day = EmptyOperator(task_id="other_day")
|
|
@@ -64,8 +58,7 @@ class BranchDayOfWeekOperator(BaseBranchOperator):
|
|
|
64
58
|
|
|
65
59
|
# import WeekDay Enum
|
|
66
60
|
from airflow.utils.weekday import WeekDay
|
|
67
|
-
from airflow.
|
|
68
|
-
from airflow.operators.weekday import BranchDayOfWeekOperator
|
|
61
|
+
from airflow.operators.empty import EmptyOperator
|
|
69
62
|
|
|
70
63
|
workday = EmptyOperator(task_id="workday")
|
|
71
64
|
weekend = EmptyOperator(task_id="weekend")
|
|
@@ -18,37 +18,15 @@
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
20
|
import datetime
|
|
21
|
-
from
|
|
22
|
-
from dataclasses import dataclass
|
|
23
|
-
from typing import TYPE_CHECKING, Any, NoReturn
|
|
21
|
+
from typing import TYPE_CHECKING, Any, NoReturn, Sequence
|
|
24
22
|
|
|
25
|
-
from airflow.providers.standard.triggers.temporal import DateTimeTrigger
|
|
26
|
-
from airflow.providers.standard.version_compat import AIRFLOW_V_3_0_PLUS
|
|
27
23
|
from airflow.sensors.base import BaseSensorOperator
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
from airflow.triggers.base import StartTriggerArgs
|
|
31
|
-
except ImportError:
|
|
32
|
-
# TODO: Remove this when min airflow version is 2.10.0 for standard provider
|
|
33
|
-
@dataclass
|
|
34
|
-
class StartTriggerArgs: # type: ignore[no-redef]
|
|
35
|
-
"""Arguments required for start task execution from triggerer."""
|
|
36
|
-
|
|
37
|
-
trigger_cls: str
|
|
38
|
-
next_method: str
|
|
39
|
-
trigger_kwargs: dict[str, Any] | None = None
|
|
40
|
-
next_kwargs: dict[str, Any] | None = None
|
|
41
|
-
timeout: datetime.timedelta | None = None
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
from airflow.triggers.base import StartTriggerArgs
|
|
25
|
+
from airflow.triggers.temporal import DateTimeTrigger
|
|
44
26
|
from airflow.utils import timezone
|
|
45
27
|
|
|
46
28
|
if TYPE_CHECKING:
|
|
47
|
-
|
|
48
|
-
from airflow.sdk.definitions.context import Context
|
|
49
|
-
except ImportError:
|
|
50
|
-
# TODO: Remove once provider drops support for Airflow 2
|
|
51
|
-
from airflow.utils.context import Context
|
|
29
|
+
from airflow.utils.context import Context
|
|
52
30
|
|
|
53
31
|
|
|
54
32
|
class DateTimeSensor(BaseSensorOperator):
|
|
@@ -59,7 +37,7 @@ class DateTimeSensor(BaseSensorOperator):
|
|
|
59
37
|
It handles some cases for which ``TimeSensor`` and ``TimeDeltaSensor`` are not suited.
|
|
60
38
|
|
|
61
39
|
**Example** 1 :
|
|
62
|
-
If a task needs to wait for 11am on each ``
|
|
40
|
+
If a task needs to wait for 11am on each ``execution_date``. Using
|
|
63
41
|
``TimeSensor`` or ``TimeDeltaSensor``, all backfill tasks started at
|
|
64
42
|
1am have to wait for 10 hours. This is unnecessary, e.g. a backfill
|
|
65
43
|
task with ``{{ ds }} = '1970-01-01'`` does not need to wait because
|
|
@@ -74,7 +52,7 @@ class DateTimeSensor(BaseSensorOperator):
|
|
|
74
52
|
|
|
75
53
|
DateTimeSensor(
|
|
76
54
|
task_id="wait_for_0100",
|
|
77
|
-
target_time="{{
|
|
55
|
+
target_time="{{ next_execution_date.tomorrow().replace(hour=1) }}",
|
|
78
56
|
)
|
|
79
57
|
|
|
80
58
|
:param target_time: datetime after which the job succeeds. (templated)
|
|
@@ -115,7 +93,7 @@ class DateTimeSensorAsync(DateTimeSensor):
|
|
|
115
93
|
"""
|
|
116
94
|
|
|
117
95
|
start_trigger_args = StartTriggerArgs(
|
|
118
|
-
trigger_cls="airflow.
|
|
96
|
+
trigger_cls="airflow.triggers.temporal.DateTimeTrigger",
|
|
119
97
|
trigger_kwargs={"moment": "", "end_from_trigger": False},
|
|
120
98
|
next_method="execute_complete",
|
|
121
99
|
next_kwargs=None,
|
|
@@ -147,9 +125,7 @@ class DateTimeSensorAsync(DateTimeSensor):
|
|
|
147
125
|
trigger=DateTimeTrigger(
|
|
148
126
|
moment=timezone.parse(self.target_time),
|
|
149
127
|
end_from_trigger=self.end_from_trigger,
|
|
150
|
-
)
|
|
151
|
-
if AIRFLOW_V_3_0_PLUS
|
|
152
|
-
else DateTimeTrigger(moment=timezone.parse(self.target_time)),
|
|
128
|
+
),
|
|
153
129
|
)
|
|
154
130
|
|
|
155
131
|
def execute_complete(self, context: Context, event: Any = None) -> None:
|
|
@@ -18,36 +18,15 @@
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
20
|
import datetime
|
|
21
|
-
from dataclasses import dataclass
|
|
22
21
|
from typing import TYPE_CHECKING, Any, NoReturn
|
|
23
22
|
|
|
24
|
-
from airflow.providers.standard.triggers.temporal import DateTimeTrigger
|
|
25
|
-
from airflow.providers.standard.version_compat import AIRFLOW_V_2_10_PLUS
|
|
26
23
|
from airflow.sensors.base import BaseSensorOperator
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
from airflow.triggers.base import StartTriggerArgs
|
|
30
|
-
except ImportError:
|
|
31
|
-
# TODO: Remove this when min airflow version is 2.10.0 for standard provider
|
|
32
|
-
@dataclass
|
|
33
|
-
class StartTriggerArgs: # type: ignore[no-redef]
|
|
34
|
-
"""Arguments required for start task execution from triggerer."""
|
|
35
|
-
|
|
36
|
-
trigger_cls: str
|
|
37
|
-
next_method: str
|
|
38
|
-
trigger_kwargs: dict[str, Any] | None = None
|
|
39
|
-
next_kwargs: dict[str, Any] | None = None
|
|
40
|
-
timeout: datetime.timedelta | None = None
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
from airflow.triggers.base import StartTriggerArgs
|
|
25
|
+
from airflow.triggers.temporal import DateTimeTrigger
|
|
43
26
|
from airflow.utils import timezone
|
|
44
27
|
|
|
45
28
|
if TYPE_CHECKING:
|
|
46
|
-
|
|
47
|
-
from airflow.sdk.definitions.context import Context
|
|
48
|
-
except ImportError:
|
|
49
|
-
# TODO: Remove once provider drops support for Airflow 2
|
|
50
|
-
from airflow.utils.context import Context
|
|
29
|
+
from airflow.utils.context import Context
|
|
51
30
|
|
|
52
31
|
|
|
53
32
|
class TimeSensor(BaseSensorOperator):
|
|
@@ -89,7 +68,7 @@ class TimeSensorAsync(BaseSensorOperator):
|
|
|
89
68
|
"""
|
|
90
69
|
|
|
91
70
|
start_trigger_args = StartTriggerArgs(
|
|
92
|
-
trigger_cls="airflow.
|
|
71
|
+
trigger_cls="airflow.triggers.temporal.DateTimeTrigger",
|
|
93
72
|
trigger_kwargs={"moment": "", "end_from_trigger": False},
|
|
94
73
|
next_method="execute_complete",
|
|
95
74
|
next_kwargs=None,
|
|
@@ -123,9 +102,7 @@ class TimeSensorAsync(BaseSensorOperator):
|
|
|
123
102
|
|
|
124
103
|
def execute(self, context: Context) -> NoReturn:
|
|
125
104
|
self.defer(
|
|
126
|
-
trigger=DateTimeTrigger(moment=self.target_datetime, end_from_trigger=self.end_from_trigger)
|
|
127
|
-
if AIRFLOW_V_2_10_PLUS
|
|
128
|
-
else DateTimeTrigger(moment=self.target_datetime),
|
|
105
|
+
trigger=DateTimeTrigger(moment=self.target_datetime, end_from_trigger=self.end_from_trigger),
|
|
129
106
|
method_name="execute_complete",
|
|
130
107
|
)
|
|
131
108
|
|
|
@@ -17,31 +17,18 @@
|
|
|
17
17
|
# under the License.
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
from datetime import
|
|
20
|
+
from datetime import timedelta
|
|
21
21
|
from time import sleep
|
|
22
22
|
from typing import TYPE_CHECKING, Any, NoReturn
|
|
23
23
|
|
|
24
|
-
from packaging.version import Version
|
|
25
|
-
|
|
26
24
|
from airflow.configuration import conf
|
|
27
25
|
from airflow.exceptions import AirflowSkipException
|
|
28
|
-
from airflow.providers.standard.triggers.temporal import DateTimeTrigger, TimeDeltaTrigger
|
|
29
|
-
from airflow.providers.standard.version_compat import AIRFLOW_V_3_0_PLUS
|
|
30
26
|
from airflow.sensors.base import BaseSensorOperator
|
|
27
|
+
from airflow.triggers.temporal import DateTimeTrigger, TimeDeltaTrigger
|
|
31
28
|
from airflow.utils import timezone
|
|
32
29
|
|
|
33
30
|
if TYPE_CHECKING:
|
|
34
|
-
|
|
35
|
-
from airflow.sdk.definitions.context import Context
|
|
36
|
-
except ImportError:
|
|
37
|
-
# TODO: Remove once provider drops support for Airflow 2
|
|
38
|
-
from airflow.utils.context import Context
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def _get_airflow_version():
|
|
42
|
-
from airflow import __version__ as airflow_version
|
|
43
|
-
|
|
44
|
-
return Version(Version(airflow_version).base_version)
|
|
31
|
+
from airflow.utils.context import Context
|
|
45
32
|
|
|
46
33
|
|
|
47
34
|
class TimeDeltaSensor(BaseSensorOperator):
|
|
@@ -62,12 +49,8 @@ class TimeDeltaSensor(BaseSensorOperator):
|
|
|
62
49
|
self.delta = delta
|
|
63
50
|
|
|
64
51
|
def poke(self, context: Context):
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if not isinstance(data_interval_end, datetime):
|
|
68
|
-
raise ValueError("`data_interval_end` returned non-datetime object")
|
|
69
|
-
|
|
70
|
-
target_dttm: datetime = data_interval_end + self.delta
|
|
52
|
+
target_dttm = context["data_interval_end"]
|
|
53
|
+
target_dttm += self.delta
|
|
71
54
|
self.log.info("Checking if the time (%s) has come", target_dttm)
|
|
72
55
|
return timezone.utcnow() > target_dttm
|
|
73
56
|
|
|
@@ -92,38 +75,19 @@ class TimeDeltaSensorAsync(TimeDeltaSensor):
|
|
|
92
75
|
self.end_from_trigger = end_from_trigger
|
|
93
76
|
|
|
94
77
|
def execute(self, context: Context) -> bool | NoReturn:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if not isinstance(data_interval_end, datetime):
|
|
98
|
-
raise ValueError("`data_interval_end` returned non-datetime object")
|
|
99
|
-
|
|
100
|
-
target_dttm: datetime = data_interval_end + self.delta
|
|
101
|
-
|
|
78
|
+
target_dttm = context["data_interval_end"]
|
|
79
|
+
target_dttm += self.delta
|
|
102
80
|
if timezone.utcnow() > target_dttm:
|
|
103
81
|
# If the target datetime is in the past, return immediately
|
|
104
82
|
return True
|
|
105
83
|
try:
|
|
106
|
-
|
|
107
|
-
trigger = DateTimeTrigger(moment=target_dttm, end_from_trigger=self.end_from_trigger)
|
|
108
|
-
else:
|
|
109
|
-
trigger = DateTimeTrigger(moment=target_dttm)
|
|
84
|
+
trigger = DateTimeTrigger(moment=target_dttm, end_from_trigger=self.end_from_trigger)
|
|
110
85
|
except (TypeError, ValueError) as e:
|
|
111
86
|
if self.soft_fail:
|
|
112
87
|
raise AirflowSkipException("Skipping due to soft_fail is set to True.") from e
|
|
113
88
|
raise
|
|
114
89
|
|
|
115
|
-
|
|
116
|
-
timeout: int | float | timedelta
|
|
117
|
-
if _get_airflow_version() >= Version("2.11.0"):
|
|
118
|
-
timeout = self.timeout
|
|
119
|
-
else:
|
|
120
|
-
timeout = timedelta(seconds=self.timeout)
|
|
121
|
-
|
|
122
|
-
self.defer(
|
|
123
|
-
trigger=trigger,
|
|
124
|
-
method_name="execute_complete",
|
|
125
|
-
timeout=timeout,
|
|
126
|
-
)
|
|
90
|
+
self.defer(trigger=trigger, method_name="execute_complete")
|
|
127
91
|
|
|
128
92
|
def execute_complete(self, context: Context, event: Any = None) -> None:
|
|
129
93
|
"""Handle the event when the trigger fires and return immediately."""
|
|
@@ -157,9 +121,7 @@ class WaitSensor(BaseSensorOperator):
|
|
|
157
121
|
def execute(self, context: Context) -> None:
|
|
158
122
|
if self.deferrable:
|
|
159
123
|
self.defer(
|
|
160
|
-
trigger=TimeDeltaTrigger(self.time_to_wait, end_from_trigger=True)
|
|
161
|
-
if AIRFLOW_V_3_0_PLUS
|
|
162
|
-
else TimeDeltaTrigger(self.time_to_wait),
|
|
124
|
+
trigger=TimeDeltaTrigger(self.time_to_wait, end_from_trigger=True),
|
|
163
125
|
method_name="execute_complete",
|
|
164
126
|
)
|
|
165
127
|
else:
|
|
@@ -17,19 +17,14 @@
|
|
|
17
17
|
# under the License.
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from typing import TYPE_CHECKING
|
|
20
|
+
from typing import TYPE_CHECKING, Iterable
|
|
22
21
|
|
|
23
22
|
from airflow.sensors.base import BaseSensorOperator
|
|
24
23
|
from airflow.utils import timezone
|
|
25
24
|
from airflow.utils.weekday import WeekDay
|
|
26
25
|
|
|
27
26
|
if TYPE_CHECKING:
|
|
28
|
-
|
|
29
|
-
from airflow.sdk.definitions.context import Context
|
|
30
|
-
except ImportError:
|
|
31
|
-
# TODO: Remove once provider drops support for Airflow 2
|
|
32
|
-
from airflow.utils.context import Context
|
|
27
|
+
from airflow.utils.context import Context
|
|
33
28
|
|
|
34
29
|
|
|
35
30
|
class DayOfWeekSensor(BaseSensorOperator):
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: apache-airflow-providers-standard
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0.dev0
|
|
4
4
|
Summary: Provider package apache-airflow-providers-standard for Apache Airflow
|
|
5
5
|
Keywords: airflow-provider,standard,airflow,integration
|
|
6
6
|
Author-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
7
7
|
Maintainer-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
8
|
-
Requires-Python: ~=3.
|
|
8
|
+
Requires-Python: ~=3.8
|
|
9
9
|
Description-Content-Type: text/x-rst
|
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
11
|
Classifier: Environment :: Console
|
|
@@ -15,22 +15,39 @@ Classifier: Intended Audience :: System Administrators
|
|
|
15
15
|
Classifier: Framework :: Apache Airflow
|
|
16
16
|
Classifier: Framework :: Apache Airflow :: Provider
|
|
17
17
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
19
|
Classifier: Programming Language :: Python :: 3.9
|
|
19
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
23
|
Classifier: Topic :: System :: Monitoring
|
|
23
|
-
Requires-Dist: apache-airflow>=2.
|
|
24
|
-
Requires-Dist: apache-airflow-providers-common-sql>=1.20.0rc0
|
|
24
|
+
Requires-Dist: apache-airflow>=2.10.0.dev0
|
|
25
25
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
26
|
-
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-standard/
|
|
27
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-standard/
|
|
26
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-standard/1.0.0/changelog.html
|
|
27
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-standard/1.0.0
|
|
28
28
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
29
29
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
30
|
-
Project-URL: Twitter, https://
|
|
30
|
+
Project-URL: Twitter, https://twitter.com/ApacheAirflow
|
|
31
31
|
Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
.. Licensed to the Apache Software Foundation (ASF) under one
|
|
35
|
+
or more contributor license agreements. See the NOTICE file
|
|
36
|
+
distributed with this work for additional information
|
|
37
|
+
regarding copyright ownership. The ASF licenses this file
|
|
38
|
+
to you under the Apache License, Version 2.0 (the
|
|
39
|
+
"License"); you may not use this file except in compliance
|
|
40
|
+
with the License. You may obtain a copy of the License at
|
|
41
|
+
|
|
42
|
+
.. http://www.apache.org/licenses/LICENSE-2.0
|
|
43
|
+
|
|
44
|
+
.. Unless required by applicable law or agreed to in writing,
|
|
45
|
+
software distributed under the License is distributed on an
|
|
46
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
47
|
+
KIND, either express or implied. See the License for the
|
|
48
|
+
specific language governing permissions and limitations
|
|
49
|
+
under the License.
|
|
50
|
+
|
|
34
51
|
.. Licensed to the Apache Software Foundation (ASF) under one
|
|
35
52
|
or more contributor license agreements. See the NOTICE file
|
|
36
53
|
distributed with this work for additional information
|
|
@@ -48,7 +65,8 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
|
|
|
48
65
|
specific language governing permissions and limitations
|
|
49
66
|
under the License.
|
|
50
67
|
|
|
51
|
-
.. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
|
|
68
|
+
.. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
|
|
69
|
+
OVERWRITTEN WHEN PREPARING PACKAGES.
|
|
52
70
|
|
|
53
71
|
.. IF YOU WANT TO MODIFY TEMPLATE FOR THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
|
|
54
72
|
`PROVIDER_README_TEMPLATE.rst.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
|
|
@@ -56,7 +74,7 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
|
|
|
56
74
|
|
|
57
75
|
Package ``apache-airflow-providers-standard``
|
|
58
76
|
|
|
59
|
-
Release: ``0.
|
|
77
|
+
Release: ``1.0.0.dev0``
|
|
60
78
|
|
|
61
79
|
|
|
62
80
|
Airflow Standard Provider
|
|
@@ -69,7 +87,7 @@ This is a provider package for ``standard`` provider. All classes for this provi
|
|
|
69
87
|
are in ``airflow.providers.standard`` python package.
|
|
70
88
|
|
|
71
89
|
You can find package information and changelog for the provider
|
|
72
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-standard/
|
|
90
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-standard/1.0.0/>`_.
|
|
73
91
|
|
|
74
92
|
Installation
|
|
75
93
|
------------
|
|
@@ -78,18 +96,16 @@ You can install this package on top of an existing Airflow 2 installation (see `
|
|
|
78
96
|
for the minimum Airflow version supported) via
|
|
79
97
|
``pip install apache-airflow-providers-standard``
|
|
80
98
|
|
|
81
|
-
The package supports the following python versions: 3.9,3.10,3.11,3.12
|
|
99
|
+
The package supports the following python versions: 3.8,3.9,3.10,3.11,3.12
|
|
82
100
|
|
|
83
101
|
Requirements
|
|
84
102
|
------------
|
|
85
103
|
|
|
86
|
-
|
|
87
|
-
PIP package
|
|
88
|
-
|
|
89
|
-
``apache-airflow``
|
|
90
|
-
|
|
91
|
-
======================================= ==================
|
|
104
|
+
================== ==================
|
|
105
|
+
PIP package Version required
|
|
106
|
+
================== ==================
|
|
107
|
+
``apache-airflow`` ``>=2.10.0``
|
|
108
|
+
================== ==================
|
|
92
109
|
|
|
93
110
|
The changelog for the provider package can be found in the
|
|
94
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-standard/
|
|
95
|
-
|
|
111
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-standard/1.0.0/changelog.html>`_.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
airflow/providers/standard/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY6fFpCV1Y,13609
|
|
2
|
+
airflow/providers/standard/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
3
|
+
airflow/providers/standard/get_provider_info.py,sha256=YOJ5MXuFZYg9TBhXtStPLjwKRCXwBj5sT1N_QE64i6s,2431
|
|
4
|
+
airflow/providers/standard/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
5
|
+
airflow/providers/standard/operators/datetime.py,sha256=nk0gwO_H8vIIu8ztA4zryWqZeoSokfINTu4o2vPUcPc,4562
|
|
6
|
+
airflow/providers/standard/operators/weekday.py,sha256=ws1FHHxFVEZhq8MDfBvNmI9pjH5QcHqueRkuanhayeQ,4474
|
|
7
|
+
airflow/providers/standard/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
8
|
+
airflow/providers/standard/sensors/date_time.py,sha256=WKoMTLuSYwNbsvvkndRmiTGa6GN3jeolAGazbPDMeUk,5179
|
|
9
|
+
airflow/providers/standard/sensors/time.py,sha256=nhKqn7eQKnx-F-MSG_yrlN7RM8ZM3iOSUwgqxc_F2SQ,4142
|
|
10
|
+
airflow/providers/standard/sensors/time_delta.py,sha256=YMNELt0m89PvWsYmWWO-m6RW-ICPOZ8rcABrmt-4xxc,4660
|
|
11
|
+
airflow/providers/standard/sensors/weekday.py,sha256=PMg0eoGuD0xNLSJIBY9C1Y0aqSZn6PkQ_j_eYo7lnks,3695
|
|
12
|
+
apache_airflow_providers_standard-1.0.0.dev0.dist-info/entry_points.txt,sha256=mW2YRh3mVdZdaP5-iGSNgmcCh3YYdALIn28BCLBZZ40,104
|
|
13
|
+
apache_airflow_providers_standard-1.0.0.dev0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
14
|
+
apache_airflow_providers_standard-1.0.0.dev0.dist-info/METADATA,sha256=unzipTVuHhQdPFzlb3VhMm9OXHFvX72zrRwrk9NUev0,4698
|
|
15
|
+
apache_airflow_providers_standard-1.0.0.dev0.dist-info/RECORD,,
|