• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agronholm / sqlacodegen / 27117669432
98%

Build:
DEFAULT BRANCH: master
Ran 08 Jun 2026 05:21AM UTC
Jobs 1
Files 11
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Jun 2026 05:20AM UTC coverage: 97.794% (-0.05%) from 97.839%
27117669432

push

github

web-flow
Preserve dialect-specific ARRAY types instead of adapting to generic ARRAY (#480)

When reflecting a PostgreSQL ``text[]`` (or any dialect-specific ARRAY) column, sqlacodegen previously walked the type's MRO in ``get_adapted_type`` and substituted ``sqlalchemy.dialects.postgresql.ARRAY`` with the generic ``sqlalchemy.ARRAY``. The generic ARRAY does not implement operators like ``.contains()``, ``.any()`` or ``.all()`` -- calling them on a generated model raises::

    NotImplementedError: ARRAY.contains() not implemented for the base ARRAY type; please use the dialect-specific ARRAY type

The workaround was to pass ``--options keep_dialect_types``, but that also forces every other type back to its dialect-specific form (``INTEGER`` instead of ``Integer``, etc.), which is more than the user wants.

This change special-cases ARRAY in ``get_adapted_type``: when the column type is a subclass of the generic ARRAY (i.e. a dialect-specific ARRAY), the original class is kept and only the item type is adapted. Plain generic ``sqlalchemy.ARRAY`` inputs are unaffected, and no other type's adaptation behavior changes.

The existing ``test_arrays`` is updated to expect the dialect-specific import, and a new ``test_array_preserves_dialect_for_runtime_operators`` test locks in the regression scenario described in the issue.

Fixes #441.

7 of 7 new or added lines in 2 files covered. (100.0%)

1 existing line in 1 file now uncovered.

1862 of 1904 relevant lines covered (97.79%)

4.89 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
96.91
-0.09% src/sqlacodegen/generators.py
Jobs
ID Job ID Ran Files Coverage
1 27117669432.1 08 Jun 2026 05:21AM UTC 11
97.79
GitHub Action Run
Source Files on build 27117669432
  • Tree
  • List 11
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27117669432
  • 592747a2 on github
  • Prev Build on master (#24046095339)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc