Skip to content

Commit 2ebd85a

Browse files
committed
Fix list of str interpretation in python raster reader
Signed-off-by: Jason T. Brown <[email protected]>
1 parent 82fd90f commit 2ebd85a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

pyrasterframes/src/main/python/pyrasterframes/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ def temp_name():
158158
# Parse the `source` argument
159159
path = None # to pass into `path` param
160160
if isinstance(source, list):
161-
path = None
162-
catalog = None
163-
options.update(dict(paths='\n'.join(str(source))))
161+
if all([isinstance(i, str) for i in source]):
162+
path = None
163+
catalog = None
164+
options.update(dict(paths='\n'.join([str(i) for i in source]))) # pass in "uri1\nuri2\nuri3\n..."
164165
elif isinstance(source, str):
165166
if '\n' in source or '\r' in source:
166167
# then the `source` string is a catalog as a CSV (header is required)

pyrasterframes/src/main/python/tests/RasterSourceTest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from pyrasterframes.rf_types import *
2323
from pyspark.sql.functions import *
2424
import os.path
25-
25+
from unittest import skip
2626
from . import TestEnvironment
2727

2828

@@ -105,6 +105,10 @@ def l8path(b):
105105
print(path_count.collect())
106106
self.assertTrue(path_count.count() == 3)
107107

108+
@skip('not implemented yet')
109+
def test_list_of_list_of_str(self):
110+
0
111+
108112
def test_schemeless_string(self):
109113
import os.path
110114
path = os.path.join(self.resource_dir, "L8-B8-Robinson-IL.tiff")

0 commit comments

Comments
 (0)