Skip to content

Commit 0b06d92

Browse files
authored
Allow update of parquet categorical refs (#1510)
1 parent ec13d27 commit 0b06d92

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

fsspec/implementations/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def close_session(loop, session):
123123
try:
124124
sync(loop, session.close, timeout=0.1)
125125
return
126-
except (TimeoutError, FSTimeoutError):
126+
except (TimeoutError, FSTimeoutError, NotImplementedError):
127127
pass
128128
connector = getattr(session, "_connector", None)
129129
if connector is not None:

fsspec/implementations/reference.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,11 @@ def write(self, field, record, base_url=None, storage_options=None):
417417
raws = np.full(self.record_size, np.nan, dtype="O")
418418
for j, data in partition.items():
419419
if isinstance(data, list):
420+
if (
421+
str(paths.dtype) == "category"
422+
and data[0] not in paths.dtype.categories
423+
):
424+
paths = paths.add_categories(data[0])
420425
paths[j] = data[0]
421426
if len(data) > 1:
422427
offsets[j] = data[1]

0 commit comments

Comments
 (0)