Skip to content

Commit

Permalink
Updated to crate-1.0.0dev1, propagating the error_trace option
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Oct 2, 2024
1 parent 314d430 commit fe63b1b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog

## Unreleased
- Updated to `crate-1.0.0dev1`, propagating the `error_trace` option properly

## 2024/08/29 0.39.0
Added `quote_relation_name` support utility function
- Added `quote_relation_name` support utility function

## 2024/06/25 0.38.0
- Added/reactivated documentation as `sqlalchemy-cratedb`
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dynamic = [
]
dependencies = [
"backports.zoneinfo<1; python_version<'3.9'",
"crate==1.0.0.dev0",
"crate==1.0.0.dev1",
"geojson<4,>=2.5",
"importlib-resources; python_version<'3.9'",
"sqlalchemy<2.1,>=1",
Expand Down
21 changes: 21 additions & 0 deletions tests/test_error_handling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import re

import pytest
import sqlalchemy as sa


def test_statement_with_error_trace(cratedb_service):
"""
Verify that the `error_trace` option works correctly.
"""
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:
connection.execute(sa.text("CREATE TABLE foo AS SELECT 1 AS _foo"))
assert ex.match(
re.escape('InvalidColumnNameException["_foo" conflicts with system column pattern]')
)
assert ex.match(
"io.crate.exceptions.InvalidColumnNameException: "
'"_foo" conflicts with system column pattern'
)

0 comments on commit fe63b1b

Please sign in to comment.