Skip to content

Commit a226a7a

Browse files
committed
Add Python 3.14 Support
Un-exclude the google provider from py3.14
1 parent 78f8c97 commit a226a7a

14 files changed

Lines changed: 38 additions & 23 deletions

File tree

dev/breeze/tests/test_selective_checks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,6 @@ def test_excluded_providers():
13851385
"3.14": [
13861386
"amazon", # Depends on lxml<6
13871387
"apache.cassandra", # Enable when the next release after 3.29.3 is available
1388-
"google", # Depends on ray, which does not yet support python 3.14 (due to pydantic v1)
13891388
],
13901389
}
13911390
),

providers/google/docs/changelog.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ Changelog
3131
21.0.0
3232
......
3333

34+
.. note::
35+
This version of the provider introduces support for Python 3.14.
36+
However, the Ray package doesn't yet support Python 3.14, thus ``RayJobHook`` will not work.
37+
If you use ``RayJobHook`` you should stay on Python<3.14 until the upstream library issues a fix.
38+
3439
.. warning::
3540
Deprecated classes, parameters and features have been removed from the Google provider package.
3641
The following breaking changes were introduced:
@@ -193,7 +198,8 @@ Doc-only
193198
......
194199

195200
.. warning::
196-
We have identified the following regressions for this version.
201+
We have identified the following regressions for this version:
202+
197203
- The return value of the ``GenAIGeminiCreateBatchJobOperator`` and ``GenAIGeminiGetBatchJobOperator`` were incompatible with Airflow 2. The issues fixed in the following PRs #61253 and #61842.
198204
- The ``transport`` parameter broke the deferrable mode for ``CloudRunExecuteJobOperator``. The issue fixed in #61546.
199205

providers/google/provider.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ versions:
123123
- 2.0.0
124124
- 1.0.0
125125

126-
excluded-python-versions:
127-
- "3.14"
128-
129126
integrations:
130127
- integration-name: Google Analytics (GA4)
131128
external-doc-url: https://analytics.google.com/

providers/google/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ classifiers = [
4949
"Programming Language :: Python :: 3.11",
5050
"Programming Language :: Python :: 3.12",
5151
"Programming Language :: Python :: 3.13",
52+
"Programming Language :: Python :: 3.14",
5253
"Topic :: System :: Monitoring",
5354
]
54-
requires-python = ">=3.10,!=3.14.*"
55+
requires-python = ">=3.10"
5556

5657
# The dependencies should be modified in place in the generated file.
5758
# Any change in the dependencies is preserved when the file is regenerated

providers/google/src/airflow/providers/google/cloud/hooks/ray.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@
1919

2020
from __future__ import annotations
2121

22+
import sys
2223
from typing import TYPE_CHECKING, Any
2324
from urllib.parse import urlparse
2425

26+
# Remove the below after https://github.com/ray-project/ray/issues/56434 is resolved
27+
if sys.version_info >= (3, 14):
28+
raise ImportError("Ray is not supported on Python 3.14 yet")
29+
2530
from ray.job_submission import JobSubmissionClient
2631

2732
from airflow.providers.google.common.hooks.base_google import GoogleBaseHook

providers/google/tests/unit/google/cloud/hooks/test_bigquery_dts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ def mock_client(self):
134134
f"{self.HOOK_MODULE_PATH}.AsyncBiqQueryDataTransferServiceHook._get_conn",
135135
new_callable=AsyncMock,
136136
) as mock_client:
137-
transfer_result = Future()
138-
transfer_result.set_result(mock.MagicMock())
139-
140-
mock_client.return_value.get_transfer_run = mock.MagicMock(return_value=transfer_result)
141137
yield mock_client
142138

143139
@pytest.fixture
@@ -147,6 +143,10 @@ def hook(self):
147143
@pytest.mark.db_test
148144
@pytest.mark.asyncio
149145
async def test_get_transfer_run(self, mock_client, hook):
146+
transfer_result = Future()
147+
transfer_result.set_result(mock.MagicMock())
148+
mock_client.return_value.get_transfer_run = mock.MagicMock(return_value=transfer_result)
149+
150150
await hook.get_transfer_run(
151151
run_id=RUN_ID,
152152
config_id=TRANSFER_CONFIG_ID,

providers/google/tests/unit/google/cloud/hooks/test_ray.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919

2020
from unittest import mock
2121

22-
from airflow.providers.google.cloud.hooks.ray import RayJobHook
22+
import pytest
2323

2424
from unit.google.cloud.utils.base_gcp_mock import (
2525
mock_base_gcp_hook_default_project_id,
2626
)
2727

28+
# Remove the below workaround once https://github.com/ray-project/ray/issues/56434 is resolved
29+
pytest.importorskip("airflow.providers.google.cloud.hooks.ray")
30+
from airflow.providers.google.cloud.hooks.ray import RayJobHook
31+
2832
TEST_GCP_CONN_ID: str = "test-gcp-conn-id"
2933
TEST_CLUSTER_NAME: str = "test-cluster-name"
3034

providers/google/tests/unit/google/cloud/hooks/vertex_ai/test_ray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import pytest
2323

24-
resources = pytest.importorskip("google.cloud.aiplatform.vertex_ray.util.resources")
24+
pytest.importorskip("google.cloud.aiplatform.vertex_ray.util.resources")
2525
from google.cloud.aiplatform.vertex_ray.util.resources import Cluster, Resources
2626

2727
from airflow.providers.google.cloud.hooks.vertex_ai.ray import RayHook

providers/google/tests/unit/google/cloud/links/test_ray.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
from unittest import mock
2121

22+
import pytest
23+
24+
# Remove the below workaround once https://github.com/ray-project/ray/issues/56434 is resolved
25+
pytest.importorskip("ray.dashboard.modules.job.common")
2226
from airflow.providers.google.cloud.links.ray import RayJobLink
2327

2428
TEST_CLUSTER_ADDRESS = "ray-head-123.us-central1.ray.googleusercontent.com"

providers/google/tests/unit/google/cloud/operators/test_ray.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
from unittest import mock
2020

2121
import pytest
22+
23+
# Remove the below workaround once https://github.com/ray-project/ray/issues/56434 is resolved
24+
pytest.importorskip("ray.dashboard.modules.job.common")
2225
from ray.dashboard.modules.job.common import JobStatus
2326

2427
from airflow.providers.common.compat.sdk import AirflowTaskTimeout

0 commit comments

Comments
 (0)