Skip to content

Commit 2bd1410

Browse files
committed
fix: Address flake8 and ruff linting issues
- Fix line too long (E501) by breaking query into multiline string - Fix unused variable (F841) by using p_brand variable correctly - Add missing newline at end of file (W292) - Remove unused batches variable (SIM113) - Apply ruff formatting
1 parent 85f8636 commit 2bd1410

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

tests/test_main.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ def test_parameterized_query_no_params():
412412

413413
assert total_rows == 5
414414

415+
415416
# ============== Cloud Parameterized Query Tests ==============
416417

417418

@@ -448,7 +449,10 @@ def test_cloud_parameterized_query_multiple_params():
448449
client = get_cloud_client()
449450

450451
reader = client.query_with_params(
451-
"SELECT o_orderkey, o_totalprice, o_orderstatus FROM tpch.orders WHERE o_totalprice > $1 AND o_orderstatus = $2 LIMIT 10",
452+
"""SELECT o_orderkey, o_totalprice, o_orderstatus
453+
FROM tpch.orders
454+
WHERE o_totalprice > $1 AND o_orderstatus = $2
455+
LIMIT 10""",
452456
[100000.0, "O"],
453457
)
454458

@@ -749,9 +753,9 @@ def test_cloud_parameterized_query_like_pattern():
749753
total_rows = 0
750754
for batch in reader:
751755
total_rows += batch.num_rows
752-
brand = batch.column("p_brand")
756+
p_brand = batch.column("p_brand")
753757
for i in range(batch.num_rows):
754-
assert batch.column("p_brand")[i].as_py() == "Brand#13"
758+
assert p_brand[i].as_py() == "Brand#13"
755759

756760
assert total_rows > 0
757761

@@ -852,9 +856,7 @@ def test_cloud_parameterized_query_larger_result_set():
852856
)
853857

854858
total_rows = 0
855-
batches = 0
856859
for batch in reader:
857-
batches += 1
858860
total_rows += batch.num_rows
859861
quantity = batch.column("l_quantity")
860862
for i in range(batch.num_rows):
@@ -942,4 +944,4 @@ def test_cloud_parameterized_query_with_bool():
942944
for i in range(batch.num_rows):
943945
assert returnflag[i].as_py() == "R"
944946

945-
assert total_rows > 0
947+
assert total_rows > 0

0 commit comments

Comments
 (0)