Skip to content
Merged
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
2 changes: 1 addition & 1 deletion storey/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ def __init__(
def _read_filtered_parquet(self, path):
fs, file_path = url_to_file_system(path, self._storage_options)

partitions_time_attributes, _ = find_partitions(path, fs)
partitions_time_attributes = find_partitions(path, fs)
filters = []
find_filters(
partitions_time_attributes,
Expand Down
9 changes: 6 additions & 3 deletions storey/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ def _get_filters_for_filter_column(start, end, filter_column, side_range):
side_range.append(upper_limit_tuple)


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

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

partitions_time_attributes = [j for j in legal_time_units if j in partitions]

return partitions_time_attributes, partitions
if return_full_partitioning:
return partitions_time_attributes, partitions
else:
return partitions_time_attributes


def find_filters(partitions_time_attributes, start, end, filters, filter_column):
Expand Down