Skip to content

Conversation

@rolandwalker
Copy link
Contributor

Description

An inline comment could change the indexing of the tokens by introducing whitespace. The re.sub() fix is brutal but doesn't change the tokens.

The fix also applies to extra whitespace without comments, which alone could also break the query_is_single_table_update() detection.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Feb 10, 2026
Copy link
Contributor

@scottnemes scottnemes left a comment

Choose a reason for hiding this comment

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

Verified that an inline comment was causing the destructive warning on single update queries with a where clause, and that this change fixes that.

An inline comment could change the indexing of the tokens by introducing
whitespace.  The re.sub() fix is brutal but doesn't change the tokens.

The fix also applies to extra whitespace without comments, which alone
could also break the query_is_single_table_update() detection.
@rolandwalker rolandwalker force-pushed the RW/fix-simple-update-where-with-comments branch from 5b90d3c to b8036ab Compare February 11, 2026 08:07
@rolandwalker rolandwalker merged commit 27c6cd2 into main Feb 11, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/fix-simple-update-where-with-comments branch February 11, 2026 08:12
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