Skip to content

Commit ace5a42

Browse files
authored
fix for find_partitions breaking change (#600)
1 parent 78b3ba1 commit ace5a42

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

storey/sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ def __init__(
10551055
def _read_filtered_parquet(self, path):
10561056
fs, file_path = url_to_file_system(path, self._storage_options)
10571057

1058-
partitions_time_attributes, _ = find_partitions(path, fs)
1058+
partitions_time_attributes = find_partitions(path, fs)
10591059
filters = []
10601060
find_filters(
10611061
partitions_time_attributes,

storey/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,10 @@ def _get_filters_for_filter_column(start, end, filter_column, side_range):
258258
side_range.append(upper_limit_tuple)
259259

260260

261-
def find_partitions(url, fs):
261+
def find_partitions(url, fs, return_full_partitioning: bool = False):
262262
# ML-1365. assuming the partitioning is symmetrical (for example both year=2020 and year=2021 directories will have
263263
# inner month partitions).
264+
# Providing return_full_partitioning=True will return also the full partitioning found (not only time attributes)
264265

265266
partitions = []
266267
partitions_time_attributes = []
@@ -291,8 +292,10 @@ def find_partition_helper(url, fs, partitions):
291292
legal_time_units = ["year", "month", "day", "hour", "minute", "second"]
292293

293294
partitions_time_attributes = [j for j in legal_time_units if j in partitions]
294-
295-
return partitions_time_attributes, partitions
295+
if return_full_partitioning:
296+
return partitions_time_attributes, partitions
297+
else:
298+
return partitions_time_attributes
296299

297300

298301
def find_filters(partitions_time_attributes, start, end, filters, filter_column):

0 commit comments

Comments
 (0)