Skip to content

Commit

Permalink
Allow update of parquet categorical refs (#1510)
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant authored Jan 23, 2024
1 parent ec13d27 commit 0b06d92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fsspec/implementations/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def close_session(loop, session):
try:
sync(loop, session.close, timeout=0.1)
return
except (TimeoutError, FSTimeoutError):
except (TimeoutError, FSTimeoutError, NotImplementedError):
pass
connector = getattr(session, "_connector", None)
if connector is not None:
Expand Down
5 changes: 5 additions & 0 deletions fsspec/implementations/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ def write(self, field, record, base_url=None, storage_options=None):
raws = np.full(self.record_size, np.nan, dtype="O")
for j, data in partition.items():
if isinstance(data, list):
if (
str(paths.dtype) == "category"
and data[0] not in paths.dtype.categories
):
paths = paths.add_categories(data[0])
paths[j] = data[0]
if len(data) > 1:
offsets[j] = data[1]
Expand Down

0 comments on commit 0b06d92

Please sign in to comment.