Skip to content

Migrate to paramstyle="pyformat", following crate-python 2.2.0#266

Draft
amotl wants to merge 7 commits into
mainfrom
paramstyle-pyformat
Draft

Migrate to paramstyle="pyformat", following crate-python 2.2.0#266
amotl wants to merge 7 commits into
mainfrom
paramstyle-pyformat

Conversation

@amotl

@amotl amotl commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

About

A few adjustments were necessary to accommodate the test suite to upstream changes in crate-python 2.2.0. The updates show that the improvement might have an impact to downstream users, so we might want to handle it with more care even in retrospective.

References

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f9e65561-7d43-42d6-bb7e-40e18ba2b719

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch paramstyle-pyformat

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@amotl

amotl commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Hi @bgunebakan. Please let me know if you think it makes sense to take over this PR, or otherwise close it without much ado at your disposal if relevant fixes are coming from upstream crate-python, so this patch might no longer be needed. Thanks!

@bgunebakan bgunebakan self-assigned this Jun 9, 2026
Comment thread tests/dict_test.py
Comment on lines 249 to 255
fake_cursor.execute.assert_called_with(
("UPDATE characters SET data['y'] = ?, data['x'] = ? WHERE characters.name = ?"),
(2, 1, "Trillian"),
(
"UPDATE characters SET data['y'] = %(data_'y'_)s, data['x'] = %(data_'x'_)s "
"WHERE characters.name = %(characters_name)s"
),
{"characters_name": "Trillian", "data_'y'_": 2, "data_'x'_": 1},
)

@amotl amotl Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't know if this result is something users would expect. Maybe they would expect a nested representation of the data column instead (if possible at all), maybe not?

{"characters_name": "Trillian", "data_'y'_": 2, "data_'x'_": 1}

Comment thread pyproject.toml
dependencies = [
"backports.zoneinfo<1; python_version<'3.9'",
"crate>=2,<3",
"crate>=2.2.1b1,<3",

@amotl amotl Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

While being work in progress, you can temporarily run this branch against crate head or any other branch for integration testing by using a dependency spec like this:

crate @ git+https://github.com/crate/crate-python.git@main

That can save a few cycles instead of needing to run pre-releases in lockstep while proceeding on harmonization matters.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you! We should drop support for python<3.10 because crate 2.1.0+ requires Python >=3.10. CI matrix had Python 3.7/3.8/3.9 in it. pip silently fell back to crate 2.0.0 on these jobs but there is no fallback with this branch, this can't work with older crate-python versions.

@amotl amotl Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi. I wanted to expand Python version compatibility because I think it is important to support people running older versions of Python despite being EOL, but it didn't land in time.

Well, I guess it's c'est la vie then; please proceed if you don't hear any other objections.

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