Fix 0762b3c7694d datetime migration on non-empty tables - #40
Merged
Conversation
Two bugs in the row-conversion loops (unix_to_datetime/datetime_to_unix)
that only manifest once a table has at least one row, so an empty-database
migration test never exercises them:
- row[column_name] used string-key indexing on a SQLAlchemy Core Row,
which SQLAlchemy 2.0 no longer supports (positional-only); switch to
row._mapping[column_name].
- cur_table was reflected once before the per-column temp_* column was
added via op.add_column, so the later cur_table.update().values({...})
didn't recognize that column ("Unconsumed column names"); re-reflect
cur_table after each op.add_column.
Verified against a database with existing rows: reproduces both failures
on the original code and succeeds after the fix.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rh1TMcQhLGM8TyQZ947Rvt
Sulla2012
reviewed
Sep 9, 2026
Sulla2012
left a comment
Contributor
There was a problem hiding this comment.
Looks good! Sorry I didn't catch this before.
Contributor
|
Can't merge due to 3.12 tests failing. |
Contributor
Author
yea I noticed that - but it's just the nersc side of things failing to download the test files I think... not sure what to do about that. |
Contributor
|
Rerunning the test is the simplest way. |
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.
Ran into a problem trying ot convert a mapcat at site that Carlos made for depth1 testing.
Claude found the following:
Two bugs in the row-conversion loops (unix_to_datetime/datetime_to_unix) that only manifest once a table has at least one row, so an empty-database migration test never exercises them:
Verified against a database with existing rows: reproduces both failures on the original code and succeeds after the fix.
Claude-Session: https://claude.ai/code/session_01Rh1TMcQhLGM8TyQZ947Rvt