Skip to content

Commit c25a6d0

Browse files
partheaLinchinshuoweiltswastTrevorBergeron
authored
feat: add support for Python 3.14 (#2232)
Co-authored-by: Lingqing Gan <lingqing.gan@gmail.com> Co-authored-by: Shuowei Li <shuowei@google.com> Co-authored-by: Tim Swena <swast@google.com> Co-authored-by: Trevor Bergeron <tbergeron@google.com>
1 parent 9e4da68 commit c25a6d0

54 files changed

Lines changed: 70 additions & 189 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/lint.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Python
1616
uses: actions/setup-python@v5
1717
with:
18-
python-version: "3.10"
18+
python-version: "3.14"
1919
- name: Install nox
2020
run: |
2121
python -m pip install --upgrade setuptools pip wheel

‎.github/workflows/unittest.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-22.04
1515
strategy:
1616
matrix:
17-
python: ['3.10', '3.11', '3.12', '3.13']
17+
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v4
@@ -48,7 +48,7 @@ jobs:
4848
- name: Setup Python
4949
uses: actions/setup-python@v5
5050
with:
51-
python-version: "3.10"
51+
python-version: "3.14"
5252
- name: Install coverage
5353
run: |
5454
python -m pip install --upgrade setuptools pip wheel

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repos:
3232
- id: isort
3333
name: isort (python)
3434
- repo: https://github.com/psf/black
35-
rev: 22.3.0
35+
rev: 23.7.0
3636
hooks:
3737
- id: black
3838
- repo: https://github.com/pycqa/flake8

‎CONTRIBUTING.rst‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

2424
- The feature must work fully on the following CPython versions:
25-
3.10, 3.11, 3.12and 3.13 on both UNIX and Windows.
25+
3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
2828
"unnecessary" is of course subjective, but new dependencies should
@@ -72,7 +72,7 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
7272

7373
- To run a single unit test::
7474

75-
$ nox -s unit-3.13 -- -k <name of test>
75+
$ nox -s unit-3.14 -- -k <name of test>
7676

7777

7878
.. note::
@@ -143,12 +143,12 @@ Running System Tests
143143
$ nox -s system
144144

145145
# Run a single system test
146-
$ nox -s system-3.13 -- -k <name of test>
146+
$ nox -s system-3.14 -- -k <name of test>
147147

148148

149149
.. note::
150150

151-
System tests are only configured to run under Python 3.10, 3.11, 3.12 and 3.13.
151+
System tests are only configured to run under Python 3.10, 3.12 and 3.14.
152152
For expediency, we do not run them in older versions of Python 3.
153153

154154
This alone will not run the tests. You'll need to change some local
@@ -262,11 +262,13 @@ We support:
262262
- `Python 3.11`_
263263
- `Python 3.12`_
264264
- `Python 3.13`_
265+
- `Python 3.14`_
265266

266267
.. _Python 3.10: https://docs.python.org/3.10/
267268
.. _Python 3.11: https://docs.python.org/3.11/
268269
.. _Python 3.12: https://docs.python.org/3.12/
269270
.. _Python 3.13: https://docs.python.org/3.13/
271+
.. _Python 3.14: https://docs.python.org/3.14/
270272

271273

272274
Supported versions can be found in our ``noxfile.py`` `config`_.

‎GEMINI.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We use `nox` to instrument our tests.
1313
- To run a single unit test:
1414

1515
```bash
16-
nox -r -s unit-3.13 -- -k <name of test>
16+
nox -r -s unit-3.14 -- -k <name of test>
1717
```
1818

1919
- Ignore this step if you lack access to Google Cloud resources. To run system
@@ -23,7 +23,7 @@ We use `nox` to instrument our tests.
2323
$ nox -r -s system
2424

2525
# Run a single system test
26-
$ nox -r -s system-3.13 -- -k <nameoftest>
26+
$ nox -r -s system-3.14 -- -k <nameoftest>
2727

2828
- The codebase must have better coverage than it had previously after each
2929
change. You can test coverage via `nox -s unit system cover` (takes a long

‎bigframes/_config/auth.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
_cached_project_default: Optional[str] =None
3131

3232

33-
defget_default_credentials_with_project() ->tuple[
34-
google.auth.credentials.Credentials, Optional[str]
35-
]:
33+
defget_default_credentials_with_project() ->(
34+
tuple[google.auth.credentials.Credentials, Optional[str]]
35+
):
3636
global_AUTH_LOCK, _cached_credentials, _cached_project_default
3737

3838
with_AUTH_LOCK:

‎bigframes/core/block_transforms.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ def skew(
618618
skew_column_ids: typing.Sequence[str],
619619
grouping_column_ids: typing.Sequence[str] = (),
620620
) ->blocks.Block:
621-
622621
original_columns=skew_column_ids
623622
column_labels=block.select_columns(original_columns).column_labels
624623

‎bigframes/core/blocks.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ def _get_sampling_option(
657657
sampling_method: Optional[str] =None,
658658
random_state: Optional[int] =None,
659659
) ->sampling_options.SamplingOptions:
660-
661660
if (sampling_methodisnotNone) and (sampling_methodnotin_SAMPLING_METHODS):
662661
raiseNotImplementedError(
663662
f"The downsampling method {sampling_method} is not implemented, "
@@ -700,7 +699,8 @@ def to_pandas_batches(
700699
"""Download results one message at a time.
701700
702701
page_size and max_results determine the size and number of batches,
703-
see https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJob#google_cloud_bigquery_job_QueryJob_result"""
702+
see https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJob#google_cloud_bigquery_job_QueryJob_result
703+
"""
704704

705705
under_10gb= (
706706
(notallow_large_results)

‎bigframes/core/compile/ibis_compiler/scalar_op_registry.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,6 @@ def to_timestamp_op_impl(x: ibis_types.Value, op: ops.ToTimestampOp):
10061006
elsetimestamp(x)
10071007
)
10081008
elifx.type() ==ibis_dtypes.Timestamp(None): # type: ignore
1009-
10101009
returntimestamp(x)
10111010
else:
10121011
# Numerical inputs.
@@ -1908,7 +1907,6 @@ def struct_op_impl(
19081907
defai_generate(
19091908
*values: ibis_types.Value, op: ops.AIGenerate
19101909
) ->ibis_types.StructValue:
1911-
19121910
returnai_ops.AIGenerate(
19131911
_construct_prompt(values, op.prompt_context), # type: ignore
19141912
op.connection_id, # type: ignore
@@ -1923,7 +1921,6 @@ def ai_generate(
19231921
defai_generate_bool(
19241922
*values: ibis_types.Value, op: ops.AIGenerateBool
19251923
) ->ibis_types.StructValue:
1926-
19271924
returnai_ops.AIGenerateBool(
19281925
_construct_prompt(values, op.prompt_context), # type: ignore
19291926
op.connection_id, # type: ignore
@@ -1937,7 +1934,6 @@ def ai_generate_bool(
19371934
defai_generate_int(
19381935
*values: ibis_types.Value, op: ops.AIGenerateInt
19391936
) ->ibis_types.StructValue:
1940-
19411937
returnai_ops.AIGenerateInt(
19421938
_construct_prompt(values, op.prompt_context), # type: ignore
19431939
op.connection_id, # type: ignore
@@ -1951,7 +1947,6 @@ def ai_generate_int(
19511947
defai_generate_double(
19521948
*values: ibis_types.Value, op: ops.AIGenerateDouble
19531949
) ->ibis_types.StructValue:
1954-
19551950
returnai_ops.AIGenerateDouble(
19561951
_construct_prompt(values, op.prompt_context), # type: ignore
19571952
op.connection_id, # type: ignore
@@ -1963,7 +1958,6 @@ def ai_generate_double(
19631958

19641959
@scalar_op_compiler.register_nary_op(ops.AIIf, pass_op=True)
19651960
defai_if(*values: ibis_types.Value, op: ops.AIIf) ->ibis_types.StructValue:
1966-
19671961
returnai_ops.AIIf(
19681962
_construct_prompt(values, op.prompt_context), # type: ignore
19691963
op.connection_id, # type: ignore
@@ -1974,7 +1968,6 @@ def ai_if(*values: ibis_types.Value, op: ops.AIIf) -> ibis_types.StructValue:
19741968
defai_classify(
19751969
*values: ibis_types.Value, op: ops.AIClassify
19761970
) ->ibis_types.StructValue:
1977-
19781971
returnai_ops.AIClassify(
19791972
_construct_prompt(values, op.prompt_context), # type: ignore
19801973
op.categories, # type: ignore
@@ -1984,7 +1977,6 @@ def ai_classify(
19841977

19851978
@scalar_op_compiler.register_nary_op(ops.AIScore, pass_op=True)
19861979
defai_score(*values: ibis_types.Value, op: ops.AIScore) ->ibis_types.StructValue:
1987-
19881980
returnai_ops.AIScore(
19891981
_construct_prompt(values, op.prompt_context), # type: ignore
19901982
op.connection_id, # type: ignore

‎bigframes/core/expression_factoring.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,9 @@ def graph_extract_scalar_exprs() -> Sequence[nodes.ColumnDef]:
381381
# TODO: We can prune expressions that won't be reused here,
382382
returntuple(nodes.ColumnDef(expr, id) forid, exprinresults.items())
383383

384-
defgraph_extract_window_expr() ->Optional[
385-
Tuple[Sequence[nodes.ColumnDef], window_spec.WindowSpec]
386-
]:
384+
defgraph_extract_window_expr() ->(
385+
Optional[Tuple[Sequence[nodes.ColumnDef], window_spec.WindowSpec]]
386+
):
387387
foridingraph.sinks:
388388
next_def=by_id[id]
389389
ifisinstance(next_def.expression, agg_expressions.WindowExpression):

0 commit comments

Comments
 (0)