Skip to content

Commit 5df2685

Browse files
mattijsdpclaude
andcommitted
refactor: Hoist metadata read options out of the member loop
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1f621c1 commit 5df2685

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

dataframely/_storage/parquet.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def _collection_from_parquet(
147147
# between lazy and eager reads
148148
data = {}
149149
collection_types = []
150+
metadata_options = _metadata_read_options(kwargs)
150151

151152
fs: AbstractFileSystem = url_to_fs(path)[0]
152153
for key in members:
@@ -160,16 +161,14 @@ def _collection_from_parquet(
160161
)
161162
if is_file:
162163
collection_types.append(
163-
_read_serialized_collection(
164-
source_path, **_metadata_read_options(kwargs)
165-
)
164+
_read_serialized_collection(source_path, **metadata_options)
166165
)
167166
else:
168167
prefix = get_file_prefix(fs)
169168
for file in fs.glob(fs.sep.join([source_path, "**", "*.parquet"])):
170169
collection_types.append(
171170
_read_serialized_collection(
172-
f"{prefix}{file}", **_metadata_read_options(kwargs)
171+
f"{prefix}{file}", **metadata_options
173172
)
174173
)
175174

0 commit comments

Comments
 (0)