apache-airflow-providers-standard 1.6.0rc1__py3-none-any.whl → 1.6.0rc2__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.
- airflow/providers/standard/decorators/bash.py +1 -1
- airflow/providers/standard/operators/hitl.py +5 -0
- airflow/providers/standard/operators/python.py +5 -5
- airflow/providers/standard/sensors/python.py +2 -3
- airflow/providers/standard/triggers/temporal.py +5 -1
- airflow/providers/standard/utils/python_virtualenv.py +10 -0
- airflow/providers/standard/version_compat.py +3 -0
- {apache_airflow_providers_standard-1.6.0rc1.dist-info → apache_airflow_providers_standard-1.6.0rc2.dist-info}/METADATA +1 -1
- {apache_airflow_providers_standard-1.6.0rc1.dist-info → apache_airflow_providers_standard-1.6.0rc2.dist-info}/RECORD +11 -11
- {apache_airflow_providers_standard-1.6.0rc1.dist-info → apache_airflow_providers_standard-1.6.0rc2.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_standard-1.6.0rc1.dist-info → apache_airflow_providers_standard-1.6.0rc2.dist-info}/entry_points.txt +0 -0
|
@@ -33,8 +33,8 @@ else:
|
|
|
33
33
|
)
|
|
34
34
|
|
|
35
35
|
from airflow.providers.standard.operators.bash import BashOperator
|
|
36
|
+
from airflow.providers.standard.version_compat import context_merge
|
|
36
37
|
from airflow.sdk.definitions._internal.types import SET_DURING_EXECUTION
|
|
37
|
-
from airflow.utils.context import context_merge
|
|
38
38
|
from airflow.utils.operator_helpers import determine_kwargs
|
|
39
39
|
|
|
40
40
|
if TYPE_CHECKING:
|
|
@@ -84,8 +84,13 @@ class HITLOperator(BaseOperator):
|
|
|
84
84
|
[notifiers] if isinstance(notifiers, BaseNotifier) else notifiers or []
|
|
85
85
|
)
|
|
86
86
|
|
|
87
|
+
self.validate_options()
|
|
87
88
|
self.validate_defaults()
|
|
88
89
|
|
|
90
|
+
def validate_options(self) -> None:
|
|
91
|
+
if not self.options:
|
|
92
|
+
raise ValueError('"options" cannot be empty.')
|
|
93
|
+
|
|
89
94
|
def validate_defaults(self) -> None:
|
|
90
95
|
"""
|
|
91
96
|
Validate whether the given defaults pass the following criteria.
|
|
@@ -51,9 +51,8 @@ from airflow.exceptions import (
|
|
|
51
51
|
from airflow.models.variable import Variable
|
|
52
52
|
from airflow.providers.standard.hooks.package_index import PackageIndexHook
|
|
53
53
|
from airflow.providers.standard.utils.python_virtualenv import prepare_virtualenv, write_python_script
|
|
54
|
-
from airflow.providers.standard.version_compat import AIRFLOW_V_3_0_PLUS, BaseOperator
|
|
54
|
+
from airflow.providers.standard.version_compat import AIRFLOW_V_3_0_PLUS, BaseOperator, context_merge
|
|
55
55
|
from airflow.utils import hashlib_wrapper
|
|
56
|
-
from airflow.utils.context import context_copy_partial, context_merge
|
|
57
56
|
from airflow.utils.file import get_unique_dag_module_name
|
|
58
57
|
from airflow.utils.operator_helpers import KeywordParameters
|
|
59
58
|
from airflow.utils.process_utils import execute_in_subprocess
|
|
@@ -487,7 +486,8 @@ class _BasePythonVirtualenvOperator(PythonOperator, metaclass=ABCMeta):
|
|
|
487
486
|
|
|
488
487
|
def execute(self, context: Context) -> Any:
|
|
489
488
|
serializable_keys = set(self._iter_serializable_context_keys())
|
|
490
|
-
|
|
489
|
+
new = {k: v for k, v in context.items() if k in serializable_keys}
|
|
490
|
+
serializable_context = cast("Context", new)
|
|
491
491
|
return super().execute(context=serializable_context)
|
|
492
492
|
|
|
493
493
|
def get_python_source(self):
|
|
@@ -889,9 +889,9 @@ class PythonVirtualenvOperator(_BasePythonVirtualenvOperator):
|
|
|
889
889
|
|
|
890
890
|
with TemporaryDirectory(prefix="venv") as tmp_dir:
|
|
891
891
|
tmp_path = Path(tmp_dir)
|
|
892
|
-
tmp_dir, temp_venv_dir = tmp_path.relative_to(tmp_path.anchor).parts
|
|
893
892
|
custom_pycache_prefix = Path(sys.pycache_prefix or "")
|
|
894
|
-
|
|
893
|
+
r_path = tmp_path.relative_to(tmp_path.anchor)
|
|
894
|
+
venv_python_cache_dir = Path.cwd() / custom_pycache_prefix / r_path
|
|
895
895
|
self._prepare_venv(tmp_path)
|
|
896
896
|
python_path = tmp_path / "bin" / "python"
|
|
897
897
|
result = self._execute_python_callable_in_subprocess(python_path)
|
|
@@ -20,8 +20,7 @@ from __future__ import annotations
|
|
|
20
20
|
from collections.abc import Callable, Mapping, Sequence
|
|
21
21
|
from typing import TYPE_CHECKING, Any
|
|
22
22
|
|
|
23
|
-
from airflow.providers.standard.version_compat import BaseSensorOperator, PokeReturnValue
|
|
24
|
-
from airflow.utils.context import context_merge
|
|
23
|
+
from airflow.providers.standard.version_compat import BaseSensorOperator, PokeReturnValue, context_merge
|
|
25
24
|
from airflow.utils.operator_helpers import determine_kwargs
|
|
26
25
|
|
|
27
26
|
if TYPE_CHECKING:
|
|
@@ -29,7 +28,7 @@ if TYPE_CHECKING:
|
|
|
29
28
|
from airflow.sdk.definitions.context import Context
|
|
30
29
|
except ImportError:
|
|
31
30
|
# TODO: Remove once provider drops support for Airflow 2
|
|
32
|
-
from airflow.utils.context import Context
|
|
31
|
+
from airflow.utils.context import Context # type: ignore[no-redef, attr-defined]
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
class PythonSensor(BaseSensorOperator):
|
|
@@ -24,7 +24,11 @@ from typing import Any
|
|
|
24
24
|
import pendulum
|
|
25
25
|
|
|
26
26
|
from airflow.triggers.base import BaseTrigger, TaskSuccessEvent, TriggerEvent
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
from airflow.sdk import timezone
|
|
30
|
+
except ImportError:
|
|
31
|
+
from airflow.utils import timezone # type: ignore[attr-defined,no-redef]
|
|
28
32
|
|
|
29
33
|
|
|
30
34
|
class DateTimeTrigger(BaseTrigger):
|
|
@@ -21,6 +21,7 @@ from __future__ import annotations
|
|
|
21
21
|
|
|
22
22
|
import os
|
|
23
23
|
import shutil
|
|
24
|
+
import warnings
|
|
24
25
|
from pathlib import Path
|
|
25
26
|
|
|
26
27
|
import jinja2
|
|
@@ -55,6 +56,15 @@ def _use_uv() -> bool:
|
|
|
55
56
|
|
|
56
57
|
def _generate_uv_cmd(tmp_dir: str, python_bin: str, system_site_packages: bool) -> list[str]:
|
|
57
58
|
"""Build the command to install the venv via UV."""
|
|
59
|
+
if python_bin == "python" or python_bin == "python3":
|
|
60
|
+
python_interpreter_exists = bool(shutil.which(python_bin))
|
|
61
|
+
if not python_interpreter_exists:
|
|
62
|
+
warnings.warn(
|
|
63
|
+
f"uv trying to use `{python_bin}` as the python interpreter. it could lead to errors if the python interpreter not found in PATH. "
|
|
64
|
+
f"please specify python_version in operator.",
|
|
65
|
+
UserWarning,
|
|
66
|
+
stacklevel=3,
|
|
67
|
+
)
|
|
58
68
|
cmd = ["uv", "venv", "--allow-existing", "--seed", "--python", python_bin]
|
|
59
69
|
if system_site_packages:
|
|
60
70
|
cmd.append("--system-site-packages")
|
|
@@ -40,9 +40,11 @@ AIRFLOW_V_3_1_PLUS: bool = get_base_airflow_version_tuple() >= (3, 1, 0)
|
|
|
40
40
|
# even though it wasn't used.
|
|
41
41
|
if AIRFLOW_V_3_1_PLUS:
|
|
42
42
|
from airflow.sdk import BaseHook, BaseOperator
|
|
43
|
+
from airflow.sdk.definitions.context import context_merge
|
|
43
44
|
else:
|
|
44
45
|
from airflow.hooks.base import BaseHook # type: ignore[attr-defined,no-redef]
|
|
45
46
|
from airflow.models.baseoperator import BaseOperator # type: ignore[no-redef]
|
|
47
|
+
from airflow.utils.context import context_merge # type: ignore[no-redef, attr-defined]
|
|
46
48
|
|
|
47
49
|
if AIRFLOW_V_3_0_PLUS:
|
|
48
50
|
from airflow.sdk import BaseOperatorLink
|
|
@@ -59,4 +61,5 @@ __all__ = [
|
|
|
59
61
|
"BaseHook",
|
|
60
62
|
"BaseSensorOperator",
|
|
61
63
|
"PokeReturnValue",
|
|
64
|
+
"context_merge",
|
|
62
65
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apache-airflow-providers-standard
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.0rc2
|
|
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>
|
|
@@ -2,9 +2,9 @@ airflow/providers/standard/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1r
|
|
|
2
2
|
airflow/providers/standard/__init__.py,sha256=HRU9nnD6x9Bv6Wqk4LgRJeoJvuUNVQQMsRz1FiSBuSc,1497
|
|
3
3
|
airflow/providers/standard/exceptions.py,sha256=8CTMCs1xVk_06piBoyP3pKX6j29riukL8V2V7miPgEU,2269
|
|
4
4
|
airflow/providers/standard/get_provider_info.py,sha256=jhENLvqCXj0mzBPmJeAvPj7XWaaNuxPLhHVVA-9rqzs,7132
|
|
5
|
-
airflow/providers/standard/version_compat.py,sha256=
|
|
5
|
+
airflow/providers/standard/version_compat.py,sha256=zXebxsadQSmoPBb2ypNHwJO65GY_E_mnNDmPNu2PPKI,2787
|
|
6
6
|
airflow/providers/standard/decorators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
7
|
-
airflow/providers/standard/decorators/bash.py,sha256=
|
|
7
|
+
airflow/providers/standard/decorators/bash.py,sha256=NuWB6q8AeTzWPeIIX-y3M-qN819BEcjNQwS32XTF6cs,4416
|
|
8
8
|
airflow/providers/standard/decorators/branch_external_python.py,sha256=G1l3_sYM38wEWMRnzRuVGmAbd4uMN5D07zm3EM3-ZWo,2584
|
|
9
9
|
airflow/providers/standard/decorators/branch_python.py,sha256=ZngmIIXTZDBfPgOI71ag6q_87eFdoxW5xTqtC60-_xQ,2503
|
|
10
10
|
airflow/providers/standard/decorators/branch_virtualenv.py,sha256=9mwTQsOKFKg0xJ4KmD0qsBPXvQUX0cBJRVtqKqaNocQ,2585
|
|
@@ -44,9 +44,9 @@ airflow/providers/standard/operators/bash.py,sha256=yzNbi20dp6PWJzXZqJ05gyMsdb6-
|
|
|
44
44
|
airflow/providers/standard/operators/branch.py,sha256=No3JoaqPjEAu7QlVf-20nzli0yYKbYorjcx885i5eeg,3970
|
|
45
45
|
airflow/providers/standard/operators/datetime.py,sha256=bYDdbfAyAlEXRRHjOgB06UhgDum6SPdd5I3u-ylPSaw,5005
|
|
46
46
|
airflow/providers/standard/operators/empty.py,sha256=BTeZ4KRykaEHLZigSBkevcStCrbPdQpWDMnO3ZdtZqw,1338
|
|
47
|
-
airflow/providers/standard/operators/hitl.py,sha256=
|
|
47
|
+
airflow/providers/standard/operators/hitl.py,sha256=zvMU5FPoaTmSPARhmKsr8qaQ0ajctdkE4V0GNaPHS3M,10054
|
|
48
48
|
airflow/providers/standard/operators/latest_only.py,sha256=VkU-nAI8QbIrmeiv4wYXBcZF0yKMkcFapormg0J5-As,5110
|
|
49
|
-
airflow/providers/standard/operators/python.py,sha256=
|
|
49
|
+
airflow/providers/standard/operators/python.py,sha256=nPRQV6OweIkf976i7AJpZn9vQziqugReJ7xtDu27s8Q,53741
|
|
50
50
|
airflow/providers/standard/operators/smooth.py,sha256=IMs5GjM42XEiroksIZ5flGQgxfRUbXZXCWxpshVinYQ,1396
|
|
51
51
|
airflow/providers/standard/operators/trigger_dagrun.py,sha256=AgJaiB4u-X-HDvdYLdseFQO_zBYb6_UijV-qmDqwqo0,16576
|
|
52
52
|
airflow/providers/standard/operators/weekday.py,sha256=Qg7LhXYtybVSGZn8uQqF-r7RB7zOXfe3R6vSGVa_rJk,5083
|
|
@@ -55,7 +55,7 @@ airflow/providers/standard/sensors/bash.py,sha256=jiysK84IwnVpQj1_lE65E_pSPE0FO8
|
|
|
55
55
|
airflow/providers/standard/sensors/date_time.py,sha256=W4lN-EXCIiJkPf6FKvJ4yx7X9vSCfKT7YjVbnjtmkrM,6481
|
|
56
56
|
airflow/providers/standard/sensors/external_task.py,sha256=lDEg2Zbwp79f6VV6uH3PXI-NiHbL4IMAO4z-1VDl4gA,28695
|
|
57
57
|
airflow/providers/standard/sensors/filesystem.py,sha256=jDgxZQ4WXRv1PSjc2o4K0Iq_AxnaPw7yIUnafK_VpaM,6050
|
|
58
|
-
airflow/providers/standard/sensors/python.py,sha256=
|
|
58
|
+
airflow/providers/standard/sensors/python.py,sha256=gFlZf3h60UtgJCarG9FN30cnPxKyLNVn46nNxu6O9aQ,3415
|
|
59
59
|
airflow/providers/standard/sensors/time.py,sha256=9kfamlG4mNJ1T39rOrhuAW41NiXFPP6RxU1ytiTIsLs,5271
|
|
60
60
|
airflow/providers/standard/sensors/time_delta.py,sha256=ggDSna-m_scLFks9zx1LoC64jQBjw7ZQqH7n96UU2BQ,7579
|
|
61
61
|
airflow/providers/standard/sensors/weekday.py,sha256=sKDQ7xC9c32DZxaGNIjqmW6HXE4hIvKC71Kt-_d9SG8,4470
|
|
@@ -63,14 +63,14 @@ airflow/providers/standard/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL
|
|
|
63
63
|
airflow/providers/standard/triggers/external_task.py,sha256=R2Wsd21pw9_gGTs9XuHafylt65hMVPisz2g6vnpLJ4o,11521
|
|
64
64
|
airflow/providers/standard/triggers/file.py,sha256=2i8-RwSjEgdOwQNcHCqLmSdpE3Ehqg4GQJ8nE3-fHxo,4886
|
|
65
65
|
airflow/providers/standard/triggers/hitl.py,sha256=39xqF8om6hLJPhcQ6t4q_ZYhrQTAfC9bwitu1cjbb7k,5127
|
|
66
|
-
airflow/providers/standard/triggers/temporal.py,sha256=
|
|
66
|
+
airflow/providers/standard/triggers/temporal.py,sha256=rqUMRsKTO46JvUbIXgReei5p9cnEd8PV4zJkLZWWOUI,4552
|
|
67
67
|
airflow/providers/standard/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
68
|
-
airflow/providers/standard/utils/python_virtualenv.py,sha256=
|
|
68
|
+
airflow/providers/standard/utils/python_virtualenv.py,sha256=logUzODR5qnUZYyew-ZEbL7rudrkTEtmnU9qTQhg0-0,8532
|
|
69
69
|
airflow/providers/standard/utils/python_virtualenv_script.jinja2,sha256=3Z334hVq6hQ9EHkOoGnAHc2_XNkZQkOJGxZArDKLc-c,2770
|
|
70
70
|
airflow/providers/standard/utils/sensor_helper.py,sha256=PNIETsl_a4BkmOypFfHdpP0VuTkC6eWKUDuwnNVaWsA,5000
|
|
71
71
|
airflow/providers/standard/utils/skipmixin.py,sha256=PMrP2vtr5Sn6eCVslAqmEpY6Rgo6ZyfR73LPXS5NGVA,8015
|
|
72
72
|
airflow/providers/standard/utils/weekday.py,sha256=ySDrIkWv-lqqxURo9E98IGInDqERec2O4y9o2hQTGiQ,2685
|
|
73
|
-
apache_airflow_providers_standard-1.6.
|
|
74
|
-
apache_airflow_providers_standard-1.6.
|
|
75
|
-
apache_airflow_providers_standard-1.6.
|
|
76
|
-
apache_airflow_providers_standard-1.6.
|
|
73
|
+
apache_airflow_providers_standard-1.6.0rc2.dist-info/entry_points.txt,sha256=mW2YRh3mVdZdaP5-iGSNgmcCh3YYdALIn28BCLBZZ40,104
|
|
74
|
+
apache_airflow_providers_standard-1.6.0rc2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
75
|
+
apache_airflow_providers_standard-1.6.0rc2.dist-info/METADATA,sha256=J3y9RNYBTZdUCuGKTKHv5lG5E8_EFDDNl_PYVEokMfY,3847
|
|
76
|
+
apache_airflow_providers_standard-1.6.0rc2.dist-info/RECORD,,
|
|
File without changes
|