Skip to content

Commit 108dc59

Browse files
committed
1 parent ed3bfe3 commit 108dc59

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pydax/loaders/_table.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ def load(self, path: Union[_typing.PathLike, Dict[str, str]], options: SchemaDic
5555
else:
5656
dtypes[column] = type_
5757

58-
return pd.read_csv(path, parse_dates=parse_dates, dtype=dtypes,
58+
return pd.read_csv(path, dtype=dtypes,
59+
# The following line after "if" is to circumvent
60+
# https://github.com/pandas-dev/pandas/issues/38489
61+
parse_dates=parse_dates if len(parse_dates) > 0 else False,
5962
encoding=options.get('encoding', 'utf-8'),
6063
delimiter=options.get('delimiter', ','))

tests/test_loaders.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def test_csv_pandas_delimiter(self, tmp_path, noaa_jfk_schema, delimiter):
217217
noaa_jfk_schema['subdatasets']['jfk_weather_cleaned']['format']['options']['delimiter'] = delimiter
218218
data = Dataset(noaa_jfk_schema, tmp_path,
219219
mode=Dataset.InitializationMode.DOWNLOAD_AND_LOAD).data['jfk_weather_cleaned']
220-
# None of these delimiters exist in the file, number of columns should be 1
220+
# None of these delimiters exist in the file, number of columns should be 1.
221221
assert len(data.columns) == 1
222222

223223
def test_csv_pandas_loader_no_path(self):

0 commit comments

Comments
 (0)