44import pyarrow as pa
55import pyarrow .compute as pc
66import pytest
7+ from upath import UPath
78
89from ..gps .columns import GPS_HARMONIZED_COLUMN_TYPES , GPSHarmonizedColumn
910from ..parser import detect_file
5051 (f .name , f ) for f in (TESTS_DATA_PATH / "fail" ).iterdir () if not f .is_dir ()
5152]
5253
54+ testdata_s3 = []
55+
56+ S3_TEST_PATHS = TESTS_DATA_PATH / "s3.csv"
57+ if S3_TEST_PATHS .exists ():
58+ with S3_TEST_PATHS .open ("r" ) as f :
59+ import csv
60+
61+ reader = csv .DictReader (f , delimiter = ";" )
62+ for row in reader :
63+ testdata_s3 .append ((row ["path" ], row ["endpoint_url" ]))
64+
5365
5466@pytest .mark .parametrize ("file,path,file_format" , testdata_success )
5567def test_parser_success (file , path , file_format ):
@@ -65,6 +77,13 @@ def test_parser_success(file, path, file_format):
6577 ).as_py ()
6678
6779
80+ @pytest .mark .parametrize ("path,endpoint_url" , testdata_s3 )
81+ def test_parser_remote (path , endpoint_url ):
82+ parser_instance = detect_file (UPath (path , anon = True , endpoint_url = endpoint_url ))
83+ table = parser_instance .as_table ()
84+ assert table
85+
86+
6887@pytest .mark .parametrize ("file,path" , testdata_fail )
6988def test_parser_fail (file , path ):
7089 with pytest .raises (NotImplementedError ):
0 commit comments