Repository navigation
refactor(oauth): drop the duplicate metadata argument in the sqlalchemy state store - #2087
Merged
Merged
Conversation
…my state store build_oauth_states_table passed the same MetaData to Table twice. The second one lands in the schema items, where MetaData's _set_parent is a no-op (SQLAlchemy 2.0.55 through 2.1), so the table, its DDL, and metadata.tables are unchanged without it. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2087 +/- ##
=======================================
Coverage 84.76% 84.76%
=======================================
Files 118 118
Lines 14129 14129
=======================================
Hits 11977 11977
Misses 2152 2152 ☔ View full report in Codecov by Harness. |
mwbrooks
approved these changes
Nov 26, 2026
mwbrooks
left a comment
Member
There was a problem hiding this comment.
✅ Thanks @WilliamBergamin! Tidy cleanup, and the DDL check in the description made this an easy one to verify.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request drops the duplicate
metadataargument inbuild_oauth_states_table, sync and async.Table(name, metadata, metadata, Column(...))passes the sameMetaDatatwice. The second lands in the schema items, whereMetaData._set_parentis a no-op (SQLAlchemy 2.0.55, our floor, through 2.1).metadata.tablesare identical with or without it.before_parent_attach/after_parent_attachfire once fewer on thatMetaData, visible only to a listener on those events.The classmethod signature is unchanged; the installation store has no duplicate.
Testing
Compare
CreateTable(SQLAlchemyOAuthStateStore.build_oauth_states_table(MetaData(), "t"))onmainand this branch: the DDL is the same. The existing sync and async state store tests build and use the table.Category
/docs(Documents)/tutorial(PythOnBoardingBot tutorial)tests/integration_tests(Automated tests for this library)Requirements
python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.shafter making the changes.🤖 Generated with Claude Code