Skip to content

Commit d829154

Browse files
committed
adjust max number of lines for CSV file imports
1 parent 48ec080 commit d829154

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.github/workflows/build_test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ concurrency:
2626

2727
env:
2828
USE_PASSWORD: "true"
29+
SF_CSV_IMPORT_MAX_ROWS: "30000"
2930

3031
jobs:
3132
lint:
@@ -168,7 +169,7 @@ jobs:
168169
# image_name=whummer/snowflake-tmp
169170
docker pull $image_name &
170171
pip install localstack
171-
IMAGE_NAME=$image_name DEBUG=1 DOCKER_FLAGS='-e SF_LOG=trace' localstack start -d
172+
IMAGE_NAME=$image_name DEBUG=1 DOCKER_FLAGS='-e SF_LOG=trace -e SF_CSV_IMPORT_MAX_ROWS=30000' localstack start -d
172173
localstack wait
173174
174175
# - name: Setup parameters file
@@ -203,7 +204,7 @@ jobs:
203204
# To specify the test name (in single test mode) pass this env variable:
204205
# SINGLE_TEST_NAME: test/path/filename.py::test_name
205206
shell: bash
206-
timeout-minutes: 15
207+
timeout-minutes: 20
207208
- name: Combine coverages
208209
run: python -m tox run -e coverage --skip-missing-interpreters false
209210
shell: bash

test/integ/test_large_put.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ def test_put_copy_large_files(tmpdir, conn_cnx, db_parameters):
1818
# generates N files
1919
number_of_files = 2
2020
number_of_lines = 200000
21+
22+
# note: adjusted for compatibility with LocalStack emulator tests
23+
number_of_lines_expected = int(os.getenv("SF_CSV_IMPORT_MAX_ROWS"))
24+
2125
tmp_dir = generate_k_lines_of_n_files(
2226
number_of_lines, number_of_files, tmp_dir=str(tmpdir.mkdir("data"))
2327
)
@@ -91,7 +95,9 @@ def mocked_file_agent(*args, **kwargs):
9195
cnt = 0
9296
for rec in c:
9397
cnt += rec[0]
94-
assert cnt == number_of_files * number_of_lines, "Number of rows"
98+
assert (
99+
cnt == number_of_files * number_of_lines_expected
100+
), "Number of rows"
95101
finally:
96102
c.close()
97103
finally:

test/integ/test_put_get_medium.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,11 @@ def run(cnx, sql):
400400
@pytest.mark.flaky(reruns=3)
401401
def test_put_copy_many_files(tmpdir, conn_cnx, db_parameters):
402402
"""Puts and Copies many_files."""
403-
# generates N files
404-
number_of_files = 100
405-
number_of_lines = 1000
403+
404+
# generates N files - note: adjusted for LocalStack, to reduce CI test times
405+
number_of_files = 50
406+
number_of_lines = 500
407+
406408
tmp_dir = generate_k_lines_of_n_files(
407409
number_of_lines, number_of_files, tmp_dir=str(tmpdir.mkdir("data"))
408410
)

0 commit comments

Comments
 (0)