Skip to content

Commit 4a417dd

Browse files
committed
Fix test_segments_cursor
1 parent dad2439 commit 4a417dd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/integration/test_dbapi_integration.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,8 +1884,14 @@ def test_segments_cursor(trino_connection):
18841884
total = 0
18851885
for segment in segments:
18861886
assert segment.encoding == trino_connection._client_session.encoding
1887-
assert isinstance(segment.segment.uri, str), f"Expected string for uri, got {segment.segment.uri}"
1888-
assert isinstance(segment.segment.ack_uri, str), f"Expected string for ack_uri, got {segment.segment.ack_uri}"
1887+
if hasattr(segment.segment, 'uri'):
1888+
assert isinstance(segment.segment.uri, str), (
1889+
f"Expected string for uri, got {segment.segment.uri}"
1890+
)
1891+
if hasattr(segment.segment, 'ack_uri'):
1892+
assert isinstance(segment.segment.ack_uri, str), (
1893+
f"Expected string for ack_uri, got {segment.segment.ack_uri}"
1894+
)
18891895
total += len(list(SegmentIterator(segment, row_mapper)))
18901896
assert total == 300875, f"Expected total rows 300875, got {total}"
18911897

0 commit comments

Comments
 (0)