diff --git a/fsspec/implementations/reference.py b/fsspec/implementations/reference.py index c14ee8302..cf88304ee 100644 --- a/fsspec/implementations/reference.py +++ b/fsspec/implementations/reference.py @@ -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] @@ -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 diff --git a/fsspec/mapping.py b/fsspec/mapping.py index 8fb9b9efb..752eef352 100644 --- a/fsspec/mapping.py +++ b/fsspec/mapping.py @@ -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) }