Skip to content

Commit 99872e4

Browse files
committed
adjust max number of lines for CSV file imports
1 parent 9f5a2a7 commit 99872e4

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
@@ -34,6 +34,7 @@ concurrency:
3434

3535
env:
3636
USE_PASSWORD: "true"
37+
SF_CSV_IMPORT_MAX_ROWS: "30000"
3738

3839
jobs:
3940
lint:
@@ -176,7 +177,7 @@ jobs:
176177
# image_name=whummer/snowflake-tmp
177178
docker pull $image_name &
178179
pip install localstack
179-
IMAGE_NAME=$image_name DEBUG=1 DOCKER_FLAGS='-e SF_LOG=trace' localstack start -d
180+
IMAGE_NAME=$image_name DEBUG=1 DOCKER_FLAGS='-e SF_LOG=trace -e SF_CSV_IMPORT_MAX_ROWS=30000' localstack start -d
180181
localstack wait
181182
182183
# - name: Setup parameters file
@@ -211,7 +212,7 @@ jobs:
211212
# To specify the test name (in single test mode) pass this env variable:
212213
# SINGLE_TEST_NAME: test/path/filename.py::test_name
213214
shell: bash
214-
timeout-minutes: 15
215+
timeout-minutes: 20
215216
- uses: actions/upload-artifact@v4
216217
if: always()
217218
with:

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)