Skip to content

fix Alembic named container rendering - #993

Merged
joe-clickhouse merged 2 commits into
mainfrom
joe/988-alembic-renders-invalid-or-lossy-python-for-nested-and-named-tuple
Aug 24, 2026
Merged

fix Alembic named container rendering#993
joe-clickhouse merged 2 commits into
mainfrom
joe/988-alembic-renders-invalid-or-lossy-python-for-nested-and-named-tuple

Conversation

@joe-clickhouse

Copy link
Copy Markdown
Contributor

Summary

Alembic autogenerate now renders Nested and named Tuple columns through raw ClickHouse type strings. Generated migrations import successfully, preserve field names through nested containers, and no longer repeat type changes.

Closes #988

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Alembic autogeneration for Nested and named Tuple types, preserving field names in generated migrations.

Changes:

  • Renders named containers through sqla_type_from_name.
  • Adds required migration imports.
  • Adds unit, integration, and changelog coverage.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
clickhouse_connect/cc_sqlalchemy/alembic/impl.py Detects and losslessly renders named containers.
clickhouse_connect/cc_sqlalchemy/alembic/adapter.py Adds the generated migration import.
tests/unit_tests/test_sqlalchemy/test_alembic.py Covers nested container rendering and imports.
tests/integration_tests/test_sqlalchemy/test_alembic.py Verifies live migration round trips.
CHANGELOG.md Documents the bug fix.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…rs-invalid-or-lossy-python-for-nested-and-named-tuple

# Conflicts:
#	CHANGELOG.md
#	tests/integration_tests/test_sqlalchemy/test_alembic.py
#	tests/unit_tests/test_sqlalchemy/test_alembic.py
@joe-clickhouse
joe-clickhouse merged commit 3700e3c into main Aug 24, 2026
37 checks passed
@joe-clickhouse
joe-clickhouse deleted the joe/988-alembic-renders-invalid-or-lossy-python-for-nested-and-named-tuple branch August 24, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alembic renders invalid or lossy Python for Nested and named Tuple

2 participants