Repository navigation
Conversation
…ver_default is false Fix regression from the comparator plugin reorganization where compare_metadata skipped evaluating identity and computed defaults when compare_server_default was unset or False. Moving the early STOP check to the dialect implementation ensures plain server defaults are skipped while preserving identity and computed defaults comparison. Fixes: sqlalchemy#1877
|
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 #1877, 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 #1877, reopen this pull request and it will stay open. If #1877 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! |
Fixes #1877
Summary of Changes
When comparator plugins were reorganized,
_user_compare_server_default()was registered withDispatchPriority.FIRST. Ifcompare_server_default=False(or was omitted, taking the default valueFalse),_user_compare_server_default()immediately returnedPriorityDispatchResult.STOP.Because
STOPhalts the entire comparator dispatch chain, later comparators (_compare_computed_default()and_compare_identity_default()) were never invoked, preventing autogenerate from detecting changes toIdentitycolumns and emitting warnings for modifiedComputedcolumns.This PR:
_user_compare_server_default()to returnPriorityDispatchResult.CONTINUEwhen_user_compare_server_defaultis not a callable.if migration_context._user_compare_server_default is False: return PriorityDispatchResult.STOPinto_dialect_impl_compare_server_default(), so that plain server default comparisons are skipped while allowing computed and identity comparators to run.tests/test_autogen_diffs.py,tests/test_oracle.py, andalembic/testing/suite/test_autogen_identity.py.docs/build/unreleased/1877.rst.