Skip to content

Commit e0037e0

Browse files
author
Jesse Whitehouse
committed
Add test that ingestion command fails if local file is blank
Added after PR feedback Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
1 parent d48d3f3 commit e0037e0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/e2e/driver_tests.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,16 @@ def test_staging_ingestion_put_fails_if_absolute_localFile_not_in_uploads_base_p
844844
query = f"PUT '{target_file}' INTO 'stage://tmp/{self.staging_ingestion_user}/tmp/11/15/file1.csv' OVERWRITE"
845845
cursor.execute(query)
846846

847+
def test_staging_ingestion_empty_local_path_fails_to_parse_at_server(self):
848+
uploads_base_path = "/var/www/html"
849+
target_file = ""
850+
851+
with pytest.raises(Error, match="EMPTY_LOCAL_FILE_IN_STAGING_ACCESS_QUERY"):
852+
with self.connection(extra_params={"uploads_base_path": uploads_base_path}) as conn:
853+
cursor = conn.cursor()
854+
query = f"PUT '{target_file}' INTO 'stage://tmp/{self.staging_ingestion_user}/tmp/11/15/file1.csv' OVERWRITE"
855+
cursor.execute(query)
856+
847857

848858

849859
def main(cli_args):

0 commit comments

Comments
 (0)