Skip to content

Commit e320183

Browse files
Unify random string generation to use random.choices
Replace list comprehension pattern with simpler random.choices(k=10). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 06cc3a6 commit e320183

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self):
2828
)
2929
self.default_work_group = os.getenv("AWS_ATHENA_DEFAULT_WORKGROUP", "primary")
3030
self.schema = "pyathena_test_" + "".join(
31-
[random.choice(string.ascii_lowercase + string.digits) for _ in range(10)]
31+
random.choices(string.ascii_lowercase + string.digits, k=10)
3232
)
3333
self.s3_filesystem_test_file_key = (
3434
f"{self.s3_staging_key}{self.schema}/filesystem/test_read/test.dat"

tests/pyathena/arrow/test_async_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def test_no_ops(self):
275275
)
276276
def test_empty_result(self, async_arrow_cursor):
277277
table = "test_pandas_cursor_empty_result_" + "".join(
278-
[random.choice(string.ascii_lowercase + string.digits) for _ in range(10)]
278+
random.choices(string.ascii_lowercase + string.digits, k=10)
279279
)
280280
query_id, future = async_arrow_cursor.execute(
281281
f"""

tests/pyathena/arrow/test_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def test_show_columns(self, arrow_cursor):
476476
)
477477
def test_empty_result(self, arrow_cursor):
478478
table = "test_arrow_cursor_empty_result_" + "".join(
479-
[random.choice(string.ascii_lowercase + string.digits) for _ in range(10)]
479+
random.choices(string.ascii_lowercase + string.digits, k=10)
480480
)
481481
df = arrow_cursor.execute(
482482
f"""

tests/pyathena/pandas/test_async_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def test_show_columns(self, async_pandas_cursor, parquet_engine, chunksize):
424424
)
425425
def test_empty_result_ddl(self, async_pandas_cursor, parquet_engine, chunksize):
426426
table = "test_pandas_cursor_empty_result_" + "".join(
427-
[random.choice(string.ascii_lowercase + string.digits) for _ in range(10)]
427+
random.choices(string.ascii_lowercase + string.digits, k=10)
428428
)
429429
query_id, future = async_pandas_cursor.execute(
430430
f"""

tests/pyathena/pandas/test_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ def test_show_columns(self, pandas_cursor, parquet_engine, chunksize):
842842
)
843843
def test_empty_result_ddl(self, pandas_cursor, parquet_engine, chunksize):
844844
table = "test_pandas_cursor_empty_result_" + "".join(
845-
[random.choice(string.ascii_lowercase + string.digits) for _ in range(10)]
845+
random.choices(string.ascii_lowercase + string.digits, k=10)
846846
)
847847
df = pandas_cursor.execute(
848848
f"""

0 commit comments

Comments
 (0)