Skip to content

Conversation

@amotl
Copy link
Member

@amotl amotl commented Nov 4, 2025

The test case validates the error_trace feature. However, the offending query became valid now, so it needed to be changed.

@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

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.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-testcase-error-trace

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 force-pushed the fix-testcase-error-trace branch from 2a06e1c to 81d3309 Compare November 4, 2025 03:54
@amotl amotl requested review from matriv and surister November 4, 2025 04:18
Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

thx!

"""
engine = sa.create_engine(cratedb_service.database.dburi, connect_args={"error_trace": True})
with engine.connect() as connection:
with pytest.raises(sa.exc.ProgrammingError) as ex:
Copy link
Member

Choose a reason for hiding this comment

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

pytest.raises has a match parameter that accepts regex

Suggested change
with pytest.raises(sa.exc.ProgrammingError) as ex:
with pytest.raises(sa.exc.ProgrammingError, match=re.escape('InvalidColumnNameException["_id" conflicts with system column]')) as ex:

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you, I didn't know that.

Here, I think I had intended to match both variants, now clarified by an inline comment. In this case, I think it is not comfortable to add them to pytest.raises(...)?

# Make sure both variants match, to validate it's actually an error trace.
assert ex.match(re.escape('InvalidColumnNameException["_id" conflicts with system column]'))
assert ex.match(
    'io.crate.exceptions.InvalidColumnNameException: "_id" conflicts with system column'
)

The test case validates the `error_trace` feature. However, the
offending query became valid now, so it needed to be changed.
@amotl amotl force-pushed the fix-testcase-error-trace branch from 81d3309 to f43c7f5 Compare November 4, 2025 22:17
@amotl amotl merged commit 4ea2d49 into main Nov 4, 2025
30 checks passed
@amotl amotl deleted the fix-testcase-error-trace branch November 4, 2025 22:31
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.

4 participants