Skip to content

Commit d255519

Browse files
committed
chore: support python 3.9
1 parent 9e87aac commit d255519

36 files changed

+102
-92
lines changed

.github/workflows/ibis-backends-cloud.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
os:
3838
- ubuntu-latest
3939
python-version:
40-
- "3.10"
40+
- "3.9"
4141
- "3.13"
4242
backend:
4343
- name: snowflake
@@ -54,7 +54,7 @@ jobs:
5454
- --extra athena
5555
include:
5656
- os: ubuntu-latest
57-
python-version: "3.10"
57+
- python-version: "3.9"
5858
backend:
5959
name: bigquery
6060
title: BigQuery

.github/workflows/ibis-backends.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- ubuntu-latest
5353
- windows-latest
5454
python-version:
55-
- "3.10"
55+
- "3.9"
5656
- "3.13"
5757
steps:
5858
- name: checkout
@@ -92,7 +92,7 @@ jobs:
9292
- ubuntu-latest
9393
- windows-latest
9494
python-version:
95-
- "3.10"
95+
- "3.9"
9696
- "3.13"
9797
backend:
9898
- name: duckdb
@@ -547,7 +547,7 @@ jobs:
547547
fail-fast: false
548548
matrix:
549549
include:
550-
- python-version: "3.10"
550+
- python-version: "3.9"
551551
pyspark-minor-version: "3.3"
552552
tag: local
553553
deps:

.github/workflows/ibis-main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
- ubuntu-latest
4747
- windows-latest
4848
python-version:
49+
- "3.9"
4950
- "3.10"
5051
- "3.11"
5152
- "3.12"

.github/workflows/nix-skip-helper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- "3.13"
4242
include:
4343
- os: ubuntu-latest
44-
python-version: "3.10"
44+
python-version: "3.9"
4545
- os: ubuntu-latest
4646
python-version: "3.11"
4747
steps:

.github/workflows/nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- "3.13"
4444
include:
4545
- os: ubuntu-latest
46-
python-version: "3.10"
46+
python-version: "3.9"
4747
- os: ubuntu-latest
4848
python-version: "3.11"
4949
steps:

flake.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,20 @@
163163
packages = {
164164
default = packages.ibis313;
165165

166-
inherit (pkgs) ibis310 ibis311 ibis312 ibis313
166+
inherit (pkgs) ibis39 ibis310 ibis311 ibis312 ibis313
167167
update-lock-files check-release-notes-spelling;
168168
};
169169

170170
checks = {
171+
ibis39-pytest = pkgs.ibis39.passthru.tests.pytest;
171172
ibis310-pytest = pkgs.ibis310.passthru.tests.pytest;
172173
ibis311-pytest = pkgs.ibis311.passthru.tests.pytest;
173174
ibis312-pytest = pkgs.ibis312.passthru.tests.pytest;
174175
ibis313-pytest = pkgs.ibis313.passthru.tests.pytest;
175176
};
176177

177178
devShells = rec {
179+
ibis39 = mkDevShell pkgs.ibisDevEnv39;
178180
ibis310 = mkDevShell pkgs.ibisDevEnv310;
179181
ibis311 = mkDevShell pkgs.ibisDevEnv311;
180182
ibis312 = mkDevShell pkgs.ibisDevEnv312;

ibis/backends/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,10 @@ def _get_backend_names(*, exclude: tuple[str] = ()) -> frozenset[str]:
15281528
15291529
"""
15301530

1531-
entrypoints = importlib.metadata.entry_points(group="ibis.backends")
1531+
if sys.version_info < (3, 10):
1532+
entrypoints = importlib.metadata.entry_points()["ibis.backends"]
1533+
else:
1534+
entrypoints = importlib.metadata.entry_points(group="ibis.backends")
15321535
return frozenset(ep.name for ep in entrypoints).difference(exclude)
15331536

15341537

ibis/backends/postgres/tests/test_udf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import functools
6+
import sys
67

78
import pytest
89

@@ -118,6 +119,11 @@ def mult_a_b(a: int, b: int) -> int:
118119
assert result["mult_result"].iat[0] == 8
119120

120121

122+
@pytest.mark.xfail(
123+
condition=sys.version_info[:2] < (3, 9),
124+
raises=TypeError,
125+
reason="no straightforward way to use new (Python 3.9) annotations syntax",
126+
)
121127
def test_array_type(test_database, table):
122128
"""Test that usage of Array types work Other scalar types can be
123129
represented either by the class or an instance, but Array types work

ibis/backends/sql/compilers/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import operator
88
import string
99
from functools import partial, reduce
10-
from typing import TYPE_CHECKING, Any, ClassVar
10+
from typing import TYPE_CHECKING, Any, Callable, ClassVar
1111

1212
import sqlglot as sg
1313
import sqlglot.expressions as sge
@@ -51,7 +51,7 @@ def AlterTable(*args, kind="TABLE", **kwargs):
5151

5252

5353
if TYPE_CHECKING:
54-
from collections.abc import Callable, Iterable, Mapping
54+
from collections.abc import Iterable, Mapping
5555

5656
import ibis.expr.schema as sch
5757
import ibis.expr.types as ir

ibis/backends/sql/compilers/bigquery/udf/core.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
import textwrap
1010
from collections import ChainMap
1111
from inspect import _empty as EMPTY
12-
from typing import TYPE_CHECKING
12+
from typing import Callable
1313

1414
from ibis.backends.sql.compilers.bigquery.udf.find import find_names
1515
from ibis.backends.sql.compilers.bigquery.udf.rewrite import rewrite
1616

17-
if TYPE_CHECKING:
18-
from collections.abc import Callable
19-
2017

2118
class SymbolTable(ChainMap):
2219
"""ChainMap subclass implementing scope for the translator.

0 commit comments

Comments
 (0)