Fix rendering of Column objects in dialect kwargs like postgresql_inc…#1802
Fix rendering of Column objects in dialect kwargs like postgresql_inc…#1802Ajaysingh-2003 wants to merge 1 commit intosqlalchemy:mainfrom
Conversation
CaselIT
left a comment
There was a problem hiding this comment.
thanks. looks almost ok:
- left a comment
- could you add a changenote here https://github.com/sqlalchemy/alembic/tree/main/docs/build/unreleased? the number is the issue. Feel free to add
Pull request courtesy of <your>at the end
tests/test_autogen_render.py
Outdated
| idx = Index( | ||
| "test_active_code_idx", | ||
| t.c.active, | ||
| somedialect_include=[t.c.code], |
There was a problem hiding this comment.
Updated, both tests now use tuples.
There was a problem hiding this comment.
I suggested only one to that we kept leveraging both code paths in the test. if it's not too much of a both I would prefer if one of the two test kept using list, so that ensure that both work.
thanks!
There was a problem hiding this comment.
Done! I updated test_render_drop_index to use a Tuple as requested, while keeping test_render_add_index as a List to comprehensively test both code paths. The tests compile properly.
fefa96d to
20a50c9
Compare
Done — added the changenote in docs/build/unreleased/1258.rst and switched the tests to use tuples. |
20a50c9 to
b6b8326
Compare
b6b8326 to
2a0441c
Compare
|
the fails seem unrelated. thanks! |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision 2a0441c of this pull request into gerrit so we can run tests and reviews and stuff
|
New Gerrit review created for change 2a0441c: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/6647 |
Fixes #1258
This PR updates
_render_dialect_kwargs_itemsinalembic/autogenerate/render.pyto properly handle list/tuple values containing Column objects, such aspostgresql_include.The implementation mirrors the logic used in
_get_index_rendered_expressions, ensuring consistent rendering behavior.Changes:
Tests:
This ensures Alembic generates valid migration scripts when using
postgresql_include.