Skip to content

Commit 0121af7

Browse files
authored
[Utils] Adding full partition output to find_partitions (#592)
1 parent 7f3f3c8 commit 0121af7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
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 & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ def find_partitions(url, fs):
263263
# inner month partitions).
264264

265265
partitions = []
266+
partitions_time_attributes = []
266267

267268
def _is_private(path):
268269
_, tail = os.path.split(path)
@@ -284,15 +285,14 @@ def find_partition_helper(url, fs, partitions):
284285
partitions.append(part[0])
285286
find_partition_helper(inner_dir, fs, partitions)
286287

287-
if fs.isfile(url):
288-
return partitions
289-
find_partition_helper(url, fs, partitions)
288+
if not fs.isfile(url):
289+
find_partition_helper(url, fs, partitions)
290290

291-
legal_time_units = ["year", "month", "day", "hour", "minute", "second"]
291+
legal_time_units = ["year", "month", "day", "hour", "minute", "second"]
292292

293-
partitions_time_attributes = [j for j in legal_time_units if j in partitions]
293+
partitions_time_attributes = [j for j in legal_time_units if j in partitions]
294294

295-
return partitions_time_attributes
295+
return partitions_time_attributes, partitions
296296

297297

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

0 commit comments

Comments
 (0)