Skip to content

Commit ccd1c8c

Browse files
Add query_id assertions to async polars cursor tests
Add assertions to verify query_id is not None in tests where the variable was previously unused, improving test coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7c55b9a commit ccd1c8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/pyathena/polars/test_async_cursor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def test_bad_query(self, async_polars_cursor):
222222
)
223223
def test_as_polars(self, async_polars_cursor):
224224
query_id, future = async_polars_cursor.execute("SELECT * FROM one_row")
225+
assert query_id is not None
225226
df = future.result().as_polars()
226227
assert isinstance(df, pl.DataFrame)
227228
assert df.height == 1
@@ -235,6 +236,7 @@ def test_as_polars(self, async_polars_cursor):
235236
)
236237
def test_many_as_polars(self, async_polars_cursor):
237238
query_id, future = async_polars_cursor.execute("SELECT * FROM many_rows")
239+
assert query_id is not None
238240
df = future.result().as_polars()
239241
assert isinstance(df, pl.DataFrame)
240242
assert df.height == 10000
@@ -247,6 +249,7 @@ def test_many_as_polars(self, async_polars_cursor):
247249
)
248250
def test_as_arrow(self, async_polars_cursor):
249251
query_id, future = async_polars_cursor.execute("SELECT * FROM one_row")
252+
assert query_id is not None
250253
table = future.result().as_arrow()
251254
assert table.num_rows == 1
252255
assert table.num_columns == 1
@@ -297,6 +300,7 @@ def test_empty_result(self, async_polars_cursor):
297300
LOCATION '{ENV.s3_staging_dir}{ENV.schema}/{table}/'
298301
"""
299302
)
303+
assert query_id is not None
300304
df = future.result().as_polars()
301305
assert df.height == 0
302306
assert df.width == 0
@@ -316,6 +320,7 @@ def test_empty_result_unload(self, async_polars_cursor):
316320
SELECT * FROM one_row LIMIT 0
317321
"""
318322
)
323+
assert query_id is not None
319324
df = future.result().as_polars()
320325
assert df.height == 0
321326
assert df.width == 0

0 commit comments

Comments
 (0)