apache-airflow-providers-yandex 4.1.0rc1__tar.gz → 4.1.1rc1__tar.gz

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.
Files changed (65) hide show
  1. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/PKG-INFO +8 -9
  2. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/README.rst +4 -4
  3. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/changelog.rst +13 -0
  4. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/index.rst +3 -3
  5. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/provider.yaml +2 -1
  6. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/pyproject.toml +4 -6
  7. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/__init__.py +1 -1
  8. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/hooks/yandex.py +5 -1
  9. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/links/yq.py +5 -18
  10. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/operators/dataproc.py +2 -6
  11. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/operators/yq.py +3 -7
  12. apache_airflow_providers_yandex-4.1.1rc1/src/airflow/providers/yandex/version_compat.py +48 -0
  13. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/hooks/test_dataproc.py +10 -1
  14. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/hooks/test_yandex.py +15 -6
  15. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/hooks/test_yq.py +10 -1
  16. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/links/test_yq.py +6 -9
  17. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/operators/test_dataproc.py +16 -6
  18. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/operators/test_yq.py +23 -21
  19. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/.latest-doc-only-change.txt +0 -0
  20. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/commits.rst +0 -0
  21. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/conf.py +0 -0
  22. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/configurations-ref.rst +0 -0
  23. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/connections/yandexcloud.rst +0 -0
  24. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/installing-providers-from-sources.rst +0 -0
  25. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/integration-logos/Yandex-Cloud.png +0 -0
  26. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/operators/dataproc.rst +0 -0
  27. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/operators/index.rst +0 -0
  28. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/operators/yq.rst +0 -0
  29. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/secrets-backends/yandex-cloud-lockbox-secret-backend.rst +0 -0
  30. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/docs/security.rst +0 -0
  31. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/__init__.py +0 -0
  32. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/__init__.py +0 -0
  33. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/LICENSE +0 -0
  34. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/get_provider_info.py +0 -0
  35. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/hooks/__init__.py +0 -0
  36. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/hooks/dataproc.py +0 -0
  37. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/hooks/yq.py +0 -0
  38. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/links/__init__.py +0 -0
  39. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/operators/__init__.py +0 -0
  40. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/secrets/__init__.py +0 -0
  41. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/secrets/lockbox.py +0 -0
  42. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/utils/__init__.py +0 -0
  43. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/utils/credentials.py +0 -0
  44. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/utils/defaults.py +0 -0
  45. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/utils/fields.py +0 -0
  46. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/src/airflow/providers/yandex/utils/user_agent.py +0 -0
  47. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/conftest.py +0 -0
  48. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/system/__init__.py +0 -0
  49. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/system/yandex/__init__.py +0 -0
  50. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/system/yandex/example_yandexcloud.py +0 -0
  51. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/system/yandex/example_yandexcloud_dataproc.py +0 -0
  52. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/system/yandex/example_yandexcloud_dataproc_lightweight.py +0 -0
  53. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/system/yandex/example_yandexcloud_yq.py +0 -0
  54. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/__init__.py +0 -0
  55. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/__init__.py +0 -0
  56. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/hooks/__init__.py +0 -0
  57. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/links/__init__.py +0 -0
  58. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/operators/__init__.py +0 -0
  59. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/secrets/__init__.py +0 -0
  60. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/secrets/test_lockbox.py +0 -0
  61. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/utils/__init__.py +0 -0
  62. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/utils/test_credentials.py +0 -0
  63. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/utils/test_defaults.py +0 -0
  64. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/utils/test_fields.py +0 -0
  65. {apache_airflow_providers_yandex-4.1.0rc1 → apache_airflow_providers_yandex-4.1.1rc1}/tests/unit/yandex/utils/test_user_agent.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-yandex
3
- Version: 4.1.0rc1
3
+ Version: 4.1.1rc1
4
4
  Summary: Provider package apache-airflow-providers-yandex for Apache Airflow
5
5
  Keywords: airflow-provider,yandex,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.9
8
+ Requires-Python: ~=3.10
9
9
  Description-Content-Type: text/x-rst
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Environment :: Console
@@ -15,7 +15,6 @@ 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.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
@@ -25,8 +24,8 @@ Requires-Dist: yandexcloud>=0.308.0
25
24
  Requires-Dist: yandex-query-client>=0.1.4
26
25
  Requires-Dist: apache-airflow-providers-common-compat ; extra == "common-compat"
27
26
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
28
- Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-yandex/4.1.0/changelog.html
29
- Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-yandex/4.1.0
27
+ Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-yandex/4.1.1/changelog.html
28
+ Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-yandex/4.1.1
30
29
  Project-URL: Mastodon, https://fosstodon.org/@airflow
31
30
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
32
31
  Project-URL: Source Code, https://github.com/apache/airflow
@@ -58,7 +57,7 @@ Provides-Extra: common-compat
58
57
 
59
58
  Package ``apache-airflow-providers-yandex``
60
59
 
61
- Release: ``4.1.0``
60
+ Release: ``4.1.1``
62
61
 
63
62
 
64
63
  This package is for Yandex, including:
@@ -73,7 +72,7 @@ This is a provider package for ``yandex`` provider. All classes for this provide
73
72
  are in ``airflow.providers.yandex`` python package.
74
73
 
75
74
  You can find package information and changelog for the provider
76
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-yandex/4.1.0/>`_.
75
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-yandex/4.1.1/>`_.
77
76
 
78
77
  Installation
79
78
  ------------
@@ -82,7 +81,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
82
81
  for the minimum Airflow version supported) via
83
82
  ``pip install apache-airflow-providers-yandex``
84
83
 
85
- The package supports the following python versions: 3.9,3.10,3.11,3.12
84
+ The package supports the following python versions: 3.10,3.11,3.12
86
85
 
87
86
  Requirements
88
87
  ------------
@@ -115,5 +114,5 @@ Dependent package
115
114
  ================================================================================================================== =================
116
115
 
117
116
  The changelog for the provider package can be found in the
118
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-yandex/4.1.0/changelog.html>`_.
117
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-yandex/4.1.1/changelog.html>`_.
119
118
 
@@ -23,7 +23,7 @@
23
23
 
24
24
  Package ``apache-airflow-providers-yandex``
25
25
 
26
- Release: ``4.1.0``
26
+ Release: ``4.1.1``
27
27
 
28
28
 
29
29
  This package is for Yandex, including:
@@ -38,7 +38,7 @@ This is a provider package for ``yandex`` provider. All classes for this provide
38
38
  are in ``airflow.providers.yandex`` python package.
39
39
 
40
40
  You can find package information and changelog for the provider
41
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-yandex/4.1.0/>`_.
41
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-yandex/4.1.1/>`_.
42
42
 
43
43
  Installation
44
44
  ------------
@@ -47,7 +47,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
47
47
  for the minimum Airflow version supported) via
48
48
  ``pip install apache-airflow-providers-yandex``
49
49
 
50
- The package supports the following python versions: 3.9,3.10,3.11,3.12
50
+ The package supports the following python versions: 3.10,3.11,3.12
51
51
 
52
52
  Requirements
53
53
  ------------
@@ -80,4 +80,4 @@ Dependent package
80
80
  ================================================================================================================== =================
81
81
 
82
82
  The changelog for the provider package can be found in the
83
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-yandex/4.1.0/changelog.html>`_.
83
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-yandex/4.1.1/changelog.html>`_.
@@ -27,6 +27,19 @@
27
27
  Changelog
28
28
  ---------
29
29
 
30
+ 4.1.1
31
+ .....
32
+
33
+ Misc
34
+ ~~~~
35
+
36
+ * ``Move 'BaseHook' implementation to task SDK (#51873)``
37
+ * ``Provider Migration: Update yandex provider for Airflow 3.0 compatibility (#52422)``
38
+ * ``Drop support for Python 3.9 (#52072)``
39
+
40
+ .. Below changes are excluded from the changelog. Move them to
41
+ appropriate section above if needed. Do not delete the lines(!):
42
+
30
43
  4.1.0
31
44
  .....
32
45
 
@@ -81,7 +81,7 @@ This package is for Yandex, including:
81
81
  - `Yandex.Cloud <https://cloud.yandex.com/>`__
82
82
 
83
83
 
84
- Release: 4.1.0
84
+ Release: 4.1.1
85
85
 
86
86
  Provider package
87
87
  ----------------
@@ -134,5 +134,5 @@ Downloading official packages
134
134
  You can download officially released packages and verify their checksums and signatures from the
135
135
  `Official Apache Download site <https://downloads.apache.org/airflow/providers/>`_
136
136
 
137
- * `The apache-airflow-providers-yandex 4.1.0 sdist package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.0.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.0.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.0.tar.gz.sha512>`__)
138
- * `The apache-airflow-providers-yandex 4.1.0 wheel package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.0-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.0-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.0-py3-none-any.whl.sha512>`__)
137
+ * `The apache-airflow-providers-yandex 4.1.1 sdist package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.1.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.1.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.1.tar.gz.sha512>`__)
138
+ * `The apache-airflow-providers-yandex 4.1.1 wheel package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.1-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.1-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_yandex-4.1.1-py3-none-any.whl.sha512>`__)
@@ -23,12 +23,13 @@ description: |
23
23
 
24
24
  - `Yandex.Cloud <https://cloud.yandex.com/>`__
25
25
  state: ready
26
- source-date-epoch: 1747134003
26
+ source-date-epoch: 1751474658
27
27
  # Note that those versions are maintained by release manager - do not update them manually
28
28
  # with the exception of case where other provider in sources has >= new provider version.
29
29
  # In such case adding >= NEW_VERSION and bumping to NEW_VERSION in a provider have
30
30
  # to be done in the same PR
31
31
  versions:
32
+ - 4.1.1
32
33
  - 4.1.0
33
34
  - 4.0.3
34
35
  - 4.0.2
@@ -25,7 +25,7 @@ build-backend = "flit_core.buildapi"
25
25
 
26
26
  [project]
27
27
  name = "apache-airflow-providers-yandex"
28
- version = "4.1.0rc1"
28
+ version = "4.1.1rc1"
29
29
  description = "Provider package apache-airflow-providers-yandex for Apache Airflow"
30
30
  readme = "README.rst"
31
31
  authors = [
@@ -44,13 +44,12 @@ classifiers = [
44
44
  "Framework :: Apache Airflow",
45
45
  "Framework :: Apache Airflow :: Provider",
46
46
  "License :: OSI Approved :: Apache Software License",
47
- "Programming Language :: Python :: 3.9",
48
47
  "Programming Language :: Python :: 3.10",
49
48
  "Programming Language :: Python :: 3.11",
50
49
  "Programming Language :: Python :: 3.12",
51
50
  "Topic :: System :: Monitoring",
52
51
  ]
53
- requires-python = "~=3.9"
52
+ requires-python = "~=3.10"
54
53
 
55
54
  # The dependencies should be modified in place in the generated file.
56
55
  # Any change in the dependencies is preserved when the file is regenerated
@@ -74,7 +73,6 @@ dev = [
74
73
  "apache-airflow",
75
74
  "apache-airflow-task-sdk",
76
75
  "apache-airflow-devel-common",
77
- "apache-airflow-providers-common-compat",
78
76
  # Additional devel dependencies (do not remove this line and add extra development dependencies)
79
77
  "responses>=0.25.0",
80
78
  ]
@@ -105,8 +103,8 @@ apache-airflow-providers-common-sql = {workspace = true}
105
103
  apache-airflow-providers-standard = {workspace = true}
106
104
 
107
105
  [project.urls]
108
- "Documentation" = "https://airflow.staged.apache.org/docs/apache-airflow-providers-yandex/4.1.0"
109
- "Changelog" = "https://airflow.staged.apache.org/docs/apache-airflow-providers-yandex/4.1.0/changelog.html"
106
+ "Documentation" = "https://airflow.staged.apache.org/docs/apache-airflow-providers-yandex/4.1.1"
107
+ "Changelog" = "https://airflow.staged.apache.org/docs/apache-airflow-providers-yandex/4.1.1/changelog.html"
110
108
  "Bug Tracker" = "https://github.com/apache/airflow/issues"
111
109
  "Source Code" = "https://github.com/apache/airflow"
112
110
  "Slack Chat" = "https://s.apache.org/airflow-slack"
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "4.1.0"
32
+ __version__ = "4.1.1"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.10.0"
@@ -20,7 +20,6 @@ from typing import Any
20
20
 
21
21
  import yandexcloud
22
22
 
23
- from airflow.hooks.base import BaseHook
24
23
  from airflow.providers.yandex.utils.credentials import (
25
24
  CredentialsType,
26
25
  get_credentials,
@@ -30,6 +29,11 @@ from airflow.providers.yandex.utils.defaults import conn_name_attr, conn_type, d
30
29
  from airflow.providers.yandex.utils.fields import get_field_from_extras
31
30
  from airflow.providers.yandex.utils.user_agent import provider_user_agent
32
31
 
32
+ try:
33
+ from airflow.sdk import BaseHook
34
+ except ImportError:
35
+ from airflow.hooks.base import BaseHook # type: ignore[attr-defined,no-redef]
36
+
33
37
 
34
38
  class YandexCloudBaseHook(BaseHook):
35
39
  """
@@ -18,24 +18,11 @@ from __future__ import annotations
18
18
 
19
19
  from typing import TYPE_CHECKING
20
20
 
21
+ from airflow.providers.yandex.version_compat import BaseOperatorLink, XCom
22
+
21
23
  if TYPE_CHECKING:
22
- from airflow.models import BaseOperator
23
24
  from airflow.models.taskinstancekey import TaskInstanceKey
24
-
25
- try:
26
- from airflow.sdk.definitions.context import Context
27
- except ImportError:
28
- # TODO: Remove once provider drops support for Airflow 2
29
- from airflow.utils.context import Context
30
-
31
- from airflow.providers.common.compat.version_compat import AIRFLOW_V_3_0_PLUS
32
-
33
- if AIRFLOW_V_3_0_PLUS:
34
- from airflow.sdk import BaseOperatorLink
35
- from airflow.sdk.execution_time.xcom import XCom
36
- else:
37
- from airflow.models import XCom # type: ignore[no-redef]
38
- from airflow.models.baseoperatorlink import BaseOperatorLink # type: ignore[no-redef]
25
+ from airflow.providers.yandex.version_compat import BaseOperator, Context
39
26
 
40
27
  XCOM_WEBLINK_KEY = "web_link"
41
28
 
@@ -49,5 +36,5 @@ class YQLink(BaseOperatorLink):
49
36
  return XCom.get_value(key=XCOM_WEBLINK_KEY, ti_key=ti_key) or "https://yq.cloud.yandex.ru"
50
37
 
51
38
  @staticmethod
52
- def persist(context: Context, task_instance: BaseOperator, web_link: str) -> None:
53
- task_instance.xcom_push(context, key=XCOM_WEBLINK_KEY, value=web_link)
39
+ def persist(context: Context, web_link: str) -> None:
40
+ context["ti"].xcom_push(key=XCOM_WEBLINK_KEY, value=web_link)
@@ -20,15 +20,11 @@ from collections.abc import Iterable, Sequence
20
20
  from dataclasses import dataclass
21
21
  from typing import TYPE_CHECKING
22
22
 
23
- from airflow.models import BaseOperator
24
23
  from airflow.providers.yandex.hooks.dataproc import DataprocHook
24
+ from airflow.providers.yandex.version_compat import BaseOperator
25
25
 
26
26
  if TYPE_CHECKING:
27
- try:
28
- from airflow.sdk.definitions.context import Context
29
- except ImportError:
30
- # TODO: Remove once provider drops support for Airflow 2
31
- from airflow.utils.context import Context
27
+ from airflow.providers.yandex.version_compat import Context
32
28
 
33
29
 
34
30
  @dataclass
@@ -20,16 +20,12 @@ from collections.abc import Sequence
20
20
  from functools import cached_property
21
21
  from typing import TYPE_CHECKING, Any
22
22
 
23
- from airflow.models import BaseOperator
24
23
  from airflow.providers.yandex.hooks.yq import YQHook
25
24
  from airflow.providers.yandex.links.yq import YQLink
25
+ from airflow.providers.yandex.version_compat import BaseOperator
26
26
 
27
27
  if TYPE_CHECKING:
28
- try:
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
28
+ from airflow.providers.yandex.version_compat import Context
33
29
 
34
30
 
35
31
  class YQExecuteQueryOperator(BaseOperator):
@@ -84,7 +80,7 @@ class YQExecuteQueryOperator(BaseOperator):
84
80
 
85
81
  # pass to YQLink
86
82
  web_link = self.hook.compose_query_web_link(self.query_id)
87
- YQLink.persist(context, self, web_link)
83
+ YQLink.persist(context, web_link)
88
84
 
89
85
  results = self.hook.wait_results(self.query_id)
90
86
  # forget query to avoid 'stop_query' in on_kill
@@ -0,0 +1,48 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The ASF licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from __future__ import annotations
19
+
20
+
21
+ def get_base_airflow_version_tuple() -> tuple[int, int, int]:
22
+ from packaging.version import Version
23
+
24
+ from airflow import __version__
25
+
26
+ airflow_version = Version(__version__)
27
+ return airflow_version.major, airflow_version.minor, airflow_version.micro
28
+
29
+
30
+ AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
31
+
32
+ if AIRFLOW_V_3_0_PLUS:
33
+ from airflow.sdk import BaseOperator, BaseOperatorLink
34
+ from airflow.sdk.definitions.context import Context
35
+ from airflow.sdk.execution_time.xcom import XCom
36
+ else:
37
+ from airflow.models import BaseOperator, XCom
38
+ from airflow.models.baseoperatorlink import BaseOperatorLink # type: ignore[no-redef]
39
+ from airflow.utils.context import Context
40
+
41
+
42
+ __all__ = [
43
+ "AIRFLOW_V_3_0_PLUS",
44
+ "BaseOperator",
45
+ "BaseOperatorLink",
46
+ "Context",
47
+ "XCom",
48
+ ]
@@ -21,6 +21,15 @@ from unittest import mock
21
21
 
22
22
  import pytest
23
23
 
24
+ try:
25
+ import importlib.util
26
+
27
+ if not importlib.util.find_spec("airflow.sdk.bases.hook"):
28
+ raise ImportError
29
+
30
+ BASEHOOK_PATCH_PATH = "airflow.sdk.bases.hook.BaseHook"
31
+ except ImportError:
32
+ BASEHOOK_PATCH_PATH = "airflow.hooks.base.BaseHook"
24
33
  yandexlcloud = pytest.importorskip("yandexcloud")
25
34
 
26
35
  from airflow.models import Connection # noqa: E402
@@ -62,7 +71,7 @@ HAS_CREDENTIALS = OAUTH_TOKEN != "my_oauth_token"
62
71
 
63
72
  class TestYandexCloudDataprocHook:
64
73
  def _init_hook(self):
65
- with mock.patch("airflow.hooks.base.BaseHook.get_connection") as mock_get_connection:
74
+ with mock.patch(f"{BASEHOOK_PATCH_PATH}.get_connection") as mock_get_connection:
66
75
  mock_get_connection.return_value = self.connection
67
76
  self.hook = DataprocHook()
68
77
 
@@ -25,11 +25,20 @@ from airflow.providers.yandex.hooks.yandex import YandexCloudBaseHook
25
25
 
26
26
  from tests_common.test_utils.config import conf_vars
27
27
 
28
+ try:
29
+ import importlib.util
30
+
31
+ if not importlib.util.find_spec("airflow.sdk.bases.hook"):
32
+ raise ImportError
33
+
34
+ BASEHOOK_PATCH_PATH = "airflow.sdk.bases.hook.BaseHook"
35
+ except ImportError:
36
+ BASEHOOK_PATCH_PATH = "airflow.hooks.base.BaseHook"
28
37
  yandexcloud = pytest.importorskip("yandexcloud")
29
38
 
30
39
 
31
40
  class TestYandexHook:
32
- @mock.patch("airflow.hooks.base.BaseHook.get_connection")
41
+ @mock.patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
33
42
  @mock.patch("airflow.providers.yandex.utils.credentials.get_credentials")
34
43
  def test_client_created_without_exceptions(self, mock_get_credentials, mock_get_connection):
35
44
  """tests `init` method to validate client creation when all parameters are passed"""
@@ -52,7 +61,7 @@ class TestYandexHook:
52
61
  )
53
62
  assert hook.client is not None
54
63
 
55
- @mock.patch("airflow.hooks.base.BaseHook.get_connection")
64
+ @mock.patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
56
65
  @mock.patch("airflow.providers.yandex.utils.credentials.get_credentials")
57
66
  def test_sdk_user_agent(self, mock_get_credentials, mock_get_connection):
58
67
  mock_get_connection.return_value = mock.Mock(yandex_conn_id="yandexcloud_default", extra_dejson="{}")
@@ -63,7 +72,7 @@ class TestYandexHook:
63
72
  hook = YandexCloudBaseHook()
64
73
  assert hook.sdk._channels._client_user_agent.startswith(sdk_prefix)
65
74
 
66
- @mock.patch("airflow.hooks.base.BaseHook.get_connection")
75
+ @mock.patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
67
76
  @mock.patch("airflow.providers.yandex.utils.credentials.get_credentials")
68
77
  def test_get_endpoint_specified(self, mock_get_credentials, mock_get_connection):
69
78
  default_folder_id = "test_id"
@@ -83,7 +92,7 @@ class TestYandexHook:
83
92
 
84
93
  assert hook._get_endpoint() == {"endpoint": "my_endpoint"}
85
94
 
86
- @mock.patch("airflow.hooks.base.BaseHook.get_connection")
95
+ @mock.patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
87
96
  @mock.patch("airflow.providers.yandex.utils.credentials.get_credentials")
88
97
  def test_get_endpoint_unspecified(self, mock_get_credentials, mock_get_connection):
89
98
  default_folder_id = "test_id"
@@ -103,7 +112,7 @@ class TestYandexHook:
103
112
 
104
113
  assert hook._get_endpoint() == {}
105
114
 
106
- @mock.patch("airflow.hooks.base.BaseHook.get_connection")
115
+ @mock.patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
107
116
  def test__get_field(self, mock_get_connection):
108
117
  field_name = "one"
109
118
  field_value = "value_one"
@@ -128,7 +137,7 @@ class TestYandexHook:
128
137
 
129
138
  assert res == field_value
130
139
 
131
- @mock.patch("airflow.hooks.base.BaseHook.get_connection")
140
+ @mock.patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
132
141
  def test__get_field_extras_not_found(self, get_connection_mock):
133
142
  field_name = "some_field"
134
143
  default = "some_default"
@@ -27,6 +27,15 @@ from responses import matchers
27
27
  from airflow.models import Connection
28
28
  from airflow.providers.yandex.hooks.yq import YQHook
29
29
 
30
+ try:
31
+ import importlib.util
32
+
33
+ if not importlib.util.find_spec("airflow.sdk.bases.hook"):
34
+ raise ImportError
35
+
36
+ BASEHOOK_PATCH_PATH = "airflow.sdk.bases.hook.BaseHook"
37
+ except ImportError:
38
+ BASEHOOK_PATCH_PATH = "airflow.hooks.base.BaseHook"
30
39
  yandexcloud = pytest.importorskip("yandexcloud")
31
40
 
32
41
  OAUTH_TOKEN = "my_oauth_token"
@@ -36,7 +45,7 @@ SERVICE_ACCOUNT_AUTH_KEY_JSON = """{"id":"my_id", "service_account_id":"my_sa1",
36
45
 
37
46
  class TestYandexCloudYqHook:
38
47
  def _init_hook(self):
39
- with mock.patch("airflow.hooks.base.BaseHook.get_connection") as mock_get_connection:
48
+ with mock.patch(f"{BASEHOOK_PATCH_PATH}.get_connection") as mock_get_connection:
40
49
  mock_get_connection.return_value = self.connection
41
50
  self.hook = YQHook(default_folder_id="my_folder_id")
42
51
 
@@ -35,18 +35,15 @@ yandexcloud = pytest.importorskip("yandexcloud")
35
35
 
36
36
 
37
37
  def test_persist():
38
- mock_context = mock.MagicMock()
38
+ mock_ti = mock.MagicMock()
39
+ mock_context = {"ti": mock_ti}
40
+ if not AIRFLOW_V_3_0_PLUS:
41
+ mock_context["task_instance"] = mock_ti
39
42
 
40
- YQLink.persist(context=mock_context, task_instance=MockOperator(task_id="test_task_id"), web_link="g.com")
43
+ YQLink.persist(context=mock_context, web_link="g.com")
41
44
 
42
45
  ti = mock_context["ti"]
43
- if AIRFLOW_V_3_0_PLUS:
44
- ti.xcom_push.assert_called_once_with(
45
- key="web_link",
46
- value="g.com",
47
- )
48
- else:
49
- ti.xcom_push.assert_called_once_with(key="web_link", value="g.com", execution_date=None)
46
+ ti.xcom_push.assert_called_once_with(key="web_link", value="g.com")
50
47
 
51
48
 
52
49
  def test_default_link():
@@ -66,6 +66,16 @@ SSH_PUBLIC_KEYS = [
66
66
  # https://cloud.yandex.com/docs/logging/concepts/log-group
67
67
  LOG_GROUP_ID = "my_log_group_id"
68
68
 
69
+ try:
70
+ import importlib.util
71
+
72
+ if not importlib.util.find_spec("airflow.sdk.bases.hook"):
73
+ raise ImportError
74
+
75
+ BASEHOOK_PATCH_PATH = "airflow.sdk.bases.hook.BaseHook"
76
+ except ImportError:
77
+ BASEHOOK_PATCH_PATH = "airflow.hooks.base.BaseHook"
78
+
69
79
 
70
80
  class TestDataprocClusterCreateOperator:
71
81
  def setup_method(self):
@@ -81,7 +91,7 @@ class TestDataprocClusterCreateOperator:
81
91
  )
82
92
 
83
93
  @patch("airflow.providers.yandex.utils.credentials.get_credentials")
84
- @patch("airflow.hooks.base.BaseHook.get_connection")
94
+ @patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
85
95
  @patch("yandexcloud._wrappers.dataproc.Dataproc.create_cluster")
86
96
  def test_create_cluster(self, mock_create_cluster, *_):
87
97
  operator = DataprocCreateClusterOperator(
@@ -145,7 +155,7 @@ class TestDataprocClusterCreateOperator:
145
155
  )
146
156
 
147
157
  @patch("airflow.providers.yandex.utils.credentials.get_credentials")
148
- @patch("airflow.hooks.base.BaseHook.get_connection")
158
+ @patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
149
159
  @patch("yandexcloud._wrappers.dataproc.Dataproc.delete_cluster")
150
160
  def test_delete_cluster_operator(self, mock_delete_cluster, *_):
151
161
  operator = DataprocDeleteClusterOperator(
@@ -159,7 +169,7 @@ class TestDataprocClusterCreateOperator:
159
169
  mock_delete_cluster.assert_called_once_with("my_cluster_id")
160
170
 
161
171
  @patch("airflow.providers.yandex.utils.credentials.get_credentials")
162
- @patch("airflow.hooks.base.BaseHook.get_connection")
172
+ @patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
163
173
  @patch("yandexcloud._wrappers.dataproc.Dataproc.create_hive_job")
164
174
  def test_create_hive_job_operator(self, mock_create_hive_job, *_):
165
175
  operator = DataprocCreateHiveJobOperator(
@@ -188,7 +198,7 @@ class TestDataprocClusterCreateOperator:
188
198
  )
189
199
 
190
200
  @patch("airflow.providers.yandex.utils.credentials.get_credentials")
191
- @patch("airflow.hooks.base.BaseHook.get_connection")
201
+ @patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
192
202
  @patch("yandexcloud._wrappers.dataproc.Dataproc.create_mapreduce_job")
193
203
  def test_create_mapreduce_job_operator(self, mock_create_mapreduce_job, *_):
194
204
  operator = DataprocCreateMapReduceJobOperator(
@@ -258,7 +268,7 @@ class TestDataprocClusterCreateOperator:
258
268
  )
259
269
 
260
270
  @patch("airflow.providers.yandex.utils.credentials.get_credentials")
261
- @patch("airflow.hooks.base.BaseHook.get_connection")
271
+ @patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
262
272
  @patch("yandexcloud._wrappers.dataproc.Dataproc.create_spark_job")
263
273
  def test_create_spark_job_operator(self, mock_create_spark_job, *_):
264
274
  operator = DataprocCreateSparkJobOperator(
@@ -320,7 +330,7 @@ class TestDataprocClusterCreateOperator:
320
330
  )
321
331
 
322
332
  @patch("airflow.providers.yandex.utils.credentials.get_credentials")
323
- @patch("airflow.hooks.base.BaseHook.get_connection")
333
+ @patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
324
334
  @patch("yandexcloud._wrappers.dataproc.Dataproc.create_pyspark_job")
325
335
  def test_create_pyspark_job_operator(self, mock_create_pyspark_job, *_):
326
336
  operator = DataprocCreatePysparkJobOperator(
@@ -32,6 +32,16 @@ from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS
32
32
 
33
33
  yandexcloud = pytest.importorskip("yandexcloud")
34
34
 
35
+ try:
36
+ import importlib.util
37
+
38
+ if not importlib.util.find_spec("airflow.sdk.bases.hook"):
39
+ raise ImportError
40
+
41
+ BASEHOOK_PATCH_PATH = "airflow.sdk.bases.hook.BaseHook"
42
+ except ImportError:
43
+ BASEHOOK_PATCH_PATH = "airflow.hooks.base.BaseHook"
44
+
35
45
  OAUTH_TOKEN = "my_oauth_token"
36
46
  FOLDER_ID = "my_folder_id"
37
47
 
@@ -50,11 +60,14 @@ class TestYQExecuteQueryOperator:
50
60
  )
51
61
 
52
62
  @responses.activate()
53
- @patch("airflow.hooks.base.BaseHook.get_connection")
63
+ @patch(f"{BASEHOOK_PATCH_PATH}.get_connection")
54
64
  def test_execute_query(self, mock_get_connection):
55
65
  mock_get_connection.return_value = Connection(extra={"oauth": OAUTH_TOKEN})
56
66
  operator = YQExecuteQueryOperator(task_id="simple_sql", sql="select 987", folder_id="my_folder_id")
57
- context = {"ti": MagicMock()}
67
+ mock_ti = MagicMock()
68
+ context = {"ti": mock_ti}
69
+ if not AIRFLOW_V_3_0_PLUS:
70
+ context["task_instance"] = operator
58
71
 
59
72
  responses.post(
60
73
  "https://api.yandex-query.cloud.yandex.net/api/fq/v1/queries",
@@ -90,25 +103,14 @@ class TestYQExecuteQueryOperator:
90
103
  results = operator.execute(context)
91
104
  assert results == {"rows": [[777]], "columns": [{"name": "column0", "type": "Int32"}]}
92
105
 
93
- if AIRFLOW_V_3_0_PLUS:
94
- context["ti"].xcom_push.assert_has_calls(
95
- [
96
- call(
97
- key="web_link",
98
- value=f"https://yq.cloud.yandex.ru/folders/{FOLDER_ID}/ide/queries/query1",
99
- ),
100
- ]
101
- )
102
- else:
103
- context["ti"].xcom_push.assert_has_calls(
104
- [
105
- call(
106
- key="web_link",
107
- value=f"https://yq.cloud.yandex.ru/folders/{FOLDER_ID}/ide/queries/query1",
108
- execution_date=None,
109
- ),
110
- ]
111
- )
106
+ context["ti"].xcom_push.assert_has_calls(
107
+ [
108
+ call(
109
+ key="web_link",
110
+ value=f"https://yq.cloud.yandex.ru/folders/{FOLDER_ID}/ide/queries/query1",
111
+ ),
112
+ ]
113
+ )
112
114
 
113
115
  responses.get(
114
116
  "https://api.yandex-query.cloud.yandex.net/api/fq/v1/queries/query1/status",