Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For nans coming out of parquet references #1663

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion fsspec/implementations/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _first(d):

def _prot_in_references(path, references):
ref = references.get(path)
if isinstance(ref, (list, tuple)):
if isinstance(ref, (list, tuple)) and isinstance(ref[0], str):
return split_protocol(ref[0])[0] if ref[0] else ref[0]


Expand Down Expand Up @@ -845,6 +845,9 @@ def cat(self, path, recursive=False, on_error="raise", **kwargs):
# found and on_error is "raise"
try:
u, s, e = self._cat_common(p)
if not isinstance(u, (bytes, str)):
# nan/None from parquet
continue
except FileNotFoundError as err:
if on_error == "raise":
raise
Expand Down
2 changes: 1 addition & 1 deletion fsspec/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def getitems(self, keys, on_error="raise"):
for k, v in out.items()
}
return {
key: out[k2]
key: out[k2] if on_error == "raise" else out.get(k2, KeyError(k2))
for key, k2 in zip(keys, keys2)
if on_error == "return" or not isinstance(out[k2], BaseException)
}
Expand Down
Loading