Skip to content

Apply and test sql_db.select for PKDict compatability.#649

Merged
robnagler merged 2 commits into
radiasoft:masterfrom
eloise-nebula:648-sql-db-pkdict-fix
May 16, 2026
Merged

Apply and test sql_db.select for PKDict compatability.#649
robnagler merged 2 commits into
radiasoft:masterfrom
eloise-nebula:648-sql-db-pkdict-fix

Conversation

@eloise-nebula

@eloise-nebula eloise-nebula commented May 14, 2026

Copy link
Copy Markdown
Contributor

SQLAlchemy Row objects do not unpack into dictionaries in 2.0 the way they did in 1.4. We often use that unpacking in slicops like this:

pkdict(sql_db.select_one(foo))

Migration guide suggests appending .mappings() to execute here:
https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#result-rows-act-like-named-tuples

See #648

@robnagler robnagler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eloise-nebula! Just a slight change.

Comment thread tests/sql_db_test.py Outdated
@eloise-nebula eloise-nebula requested a review from robnagler May 15, 2026 18:34
@robnagler robnagler enabled auto-merge (squash) May 15, 2026 19:25
@robnagler robnagler disabled auto-merge May 15, 2026 19:26
@robnagler robnagler enabled auto-merge (squash) May 15, 2026 19:26
@robnagler robnagler merged commit 0aca089 into radiasoft:master May 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants