Skip to content

Commit 1e44de9

Browse files
rusackasclaude
authored andcommitted
fix(testcontainers): address remaining reviewer feedback (db2 arm64, cockroachdb DBAPI docs, stale workflow refs)
- requirements/development.in + testcontainers.yml: scope the `db2` extra (`ibm-db-sa`/`ibm-db`) out of the baseline dev install. `ibm-db` ships no Linux arm64 wheel, so bundling it there broke the multi-platform dev Docker image build on push. The testcontainers CI job now installs it directly, only for its own db2 matrix leg. - cockroachdb.py: list `psycopg2-binary` alongside `sqlalchemy-cockroachdb` in the `pypi_packages` metadata, since a plain `cockroachdb://` URL can't connect without a DBAPI and sqlalchemy-cockroachdb doesn't install one. - test_cockroachdb.py/test_crate.py/test_trino.py: fix stale docstring references to the old `nightly-testcontainers.yml` filename. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9eca9f3 commit 1e44de9

7 files changed

Lines changed: 25 additions & 17 deletions

File tree

‎.github/workflows/testcontainers.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ jobs:
7777
uses: ./.github/actions/setup-backend/
7878
with:
7979
python-version: current
80+
- name: Install db2 driver (ibm-db-sa)
81+
# ibm-db (the db2 DBAPI) ships no Linux arm64 wheel, so it's kept out
82+
# of the baseline dev install (requirements/development.in) to avoid
83+
# breaking the multi-platform dev Docker image build. Install it here
84+
# instead, only for this leg of the matrix.
85+
if: matrix.dialect == 'db2'
86+
run: uv pip install --system -e .[db2]
8087
- name: Run testcontainers db_engine_specs tests (${{ matrix.dialect }})
8188
run: |
8289
pytest --durations-min=2 -v -m testcontainers \

‎requirements/development.in‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
#
19-
-e .[development,bigquery,cockroachdb,crate,db2,druid,duckdb,elasticsearch,fastmcp,gevent,gsheets,mssql,mysql,oracle,postgres,presto,prophet,trino,thumbnails]
19+
-e .[development,bigquery,cockroachdb,crate,druid,duckdb,elasticsearch,fastmcp,gevent,gsheets,mssql,mysql,oracle,postgres,presto,prophet,trino,thumbnails]
2020
-e ./superset-extensions-cli[test]
2121
# testcontainers-backed db_engine_specs tests (tests/testcontainers/) --
2222
# see .github/workflows/testcontainers.yml
23+
#
24+
# `db2` (the `ibm-db-sa`/`ibm-db` driver) is deliberately left out of the
25+
# baseline dev install above: `ibm-db` ships no Linux arm64 wheel, so
26+
# including it here breaks the multi-platform (amd64+arm64) dev Docker
27+
# image build. The testcontainers CI job installs it on demand, only for
28+
# the db2 matrix leg -- see .github/workflows/testcontainers.yml.
2329
testcontainers[cockroachdb,cratedb,db2,mssql,oracle,trino]>=4.15.0,<5

‎requirements/development.txt‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,6 @@ humanize==4.12.3
436436
# via
437437
# -c requirements/base-constraint.txt
438438
# apache-superset
439-
ibm-db==3.3.0
440-
# via ibm-db-sa
441-
ibm-db-sa==0.4.4
442-
# via apache-superset
443439
identify==2.5.36
444440
# via pre-commit
445441
idna==3.15
@@ -994,7 +990,6 @@ sqlalchemy==2.0.52
994990
# elasticsearch-dbapi
995991
# flask-appbuilder
996992
# flask-sqlalchemy
997-
# ibm-db-sa
998993
# marshmallow-sqlalchemy
999994
# shillelagh
1000995
# sqlalchemy-bigquery

‎superset/db_engine_specs/cockroachdb.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ class CockroachDbEngineSpec(PostgresEngineSpec):
4444
DatabaseCategory.TRADITIONAL_RDBMS,
4545
DatabaseCategory.OPEN_SOURCE,
4646
],
47-
"pypi_packages": ["sqlalchemy-cockroachdb", "psycopg2"],
47+
# sqlalchemy-cockroachdb declares no DBAPI dependency of its own (see
48+
# the comment on the `cockroachdb` extra in pyproject.toml), so a
49+
# plain `cockroachdb://` URL also needs psycopg2 installed to connect.
50+
"pypi_packages": ["sqlalchemy-cockroachdb", "psycopg2-binary"],
4851
"connection_string": "cockroachdb://root@{hostname}:{port}/{database}?sslmode=disable",
4952
"default_port": 26257,
5053
"docs_url": "https://github.com/cockroachdb/sqlalchemy-cockroachdb",

‎tests/testcontainers/db_engine_specs/test_cockroachdb.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
# under the License.
1717
"""
1818
Tests db_engine_specs.cockroachdb against a real CockroachDB instance,
19-
spun up on demand via testcontainers. Run nightly (see
20-
.github/workflows/nightly-testcontainers.yml), not on every merge -- these
21-
exercise real SQL execution and dialect introspection, which mocked unit
22-
tests structurally cannot.
19+
spun up on demand via testcontainers. Run via
20+
.github/workflows/testcontainers.yml -- these exercise real SQL execution
21+
and dialect introspection, which mocked unit tests structurally cannot.
2322
"""
2423

2524
from collections.abc import Iterator

‎tests/testcontainers/db_engine_specs/test_crate.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
# under the License.
1717
"""
1818
Tests db_engine_specs.crate against a real CrateDB instance, spun up on
19-
demand via testcontainers. Run nightly (see
20-
.github/workflows/nightly-testcontainers.yml), not on every merge.
19+
demand via testcontainers. Run via .github/workflows/testcontainers.yml.
2120
2221
crate/crate only publishes an amd64 image (no arm64 build), and requires a
2322
host CPU supporting the x86-64-v3 instruction set -- QEMU emulation on

‎tests/testcontainers/db_engine_specs/test_trino.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
# under the License.
1717
"""
1818
Tests db_engine_specs.trino against a real Trino instance, spun up on
19-
demand via testcontainers. Run nightly (see
20-
.github/workflows/nightly-testcontainers.yml), not on every merge. Only
21-
Presto is covered by existing docker-compose-based integration CI; Trino,
22-
despite sharing lineage with Presto, is not.
19+
demand via testcontainers. Run via .github/workflows/testcontainers.yml.
20+
Only Presto is covered by existing docker-compose-based integration CI;
21+
Trino, despite sharing lineage with Presto, is not.
2322
"""
2423

2524
from collections.abc import Iterator

0 commit comments

Comments
 (0)