Use ForeignKey target accessors instead of splitting colspecs - #1861
Use ForeignKey target accessors instead of splitting colspecs#1861gyanu2507 wants to merge 1 commit into
Conversation
SQLAlchemy 2.1 tracks schema/table/column separately so a dot inside a name is not a separator. Use those public attributes when present and keep the old split as a fallback for 2.0.
|
Hi, and thanks for the pull request! This project accepts pull requests only for issues that a maintainer has already marked with the open for pull requests label. That way we can settle on an approach before anyone spends time writing code. This pull request references issue #1860, which hasn't been marked open for pull requests, so the change isn't authorized yet and I'm closing it automatically. Once a maintainer adds the label to #1860, reopen this pull request and it will stay open. If #1860 needs more detail before that can happen, a complete runnable example is usually the missing piece, and adding one to the issue is the fastest way to get there. This is automatic and procedural. It isn't a judgment on your change, and nothing you've written here is lost. Thanks for your interest in the project! |
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 30e3e21 of this pull request into gerrit so we can run tests and reviews and stuff
|
New Gerrit review created for change 30e3e21: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/6934 |
|
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/6934 has been merged. Congratulations! :) |
Alembic was splitting ForeignKey._get_colspec() on ".", which cannot tell a dot inside a name from the separator between schema/table/column. SQLAlchemy 2.1 exposes target_tokens / target_table_key / target_column for this.
Wired those in through sqla_compat, with the old split as a fallback on 2.0.
Fixes #1860