From ecfb3d40457a9a69381d1cd84b21cccdf3997008 Mon Sep 17 00:00:00 2001 From: Raphael Hagen Date: Thu, 26 Sep 2024 15:29:07 -0600 Subject: [PATCH] adds lazy_reference_mapper_kwargs to refs_to_dataframe --- kerchunk/df.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kerchunk/df.py b/kerchunk/df.py index 7bd2bfb5..a9a28af4 100644 --- a/kerchunk/df.py +++ b/kerchunk/df.py @@ -6,6 +6,7 @@ import fsspec import zarr +from typing import Any, Dict # example from preffs's README' df = pd.DataFrame( @@ -106,6 +107,7 @@ def refs_to_dataframe( storage_options=None, record_size=100_000, categorical_threshold=10, + lazy_reference_mapper_kwargs: Dict[str, Any] = {}, ): """Write references as a parquet files store. @@ -134,6 +136,8 @@ def refs_to_dataframe( Encode urls as pandas.Categorical to reduce memory footprint if the ratio of the number of unique urls to total number of refs for each variable is greater than or equal to this number. (default 10) + lazy_reference_mapper_kwargs : Dict[str, Any] + Optional kwargs to pass into LazyReferenceMapper """ from fsspec.implementations.reference import LazyReferenceMapper @@ -156,6 +160,7 @@ def refs_to_dataframe( root=url, fs=fs, categorical_threshold=categorical_threshold, + **lazy_reference_mapper_kwargs, ) for k in sorted(refs):