33
33
34
34
35
35
def read_bucket_info (bucket_dir ):
36
- os .makedirs (bucket_dir , exist_ok = True )
37
36
bucket_info_filepath = os .path .join (bucket_dir , "bucket_info.yaml" )
38
37
bucket_info = read_yaml (filepath = bucket_info_filepath )
39
38
return bucket_info
@@ -47,14 +46,19 @@ def get_bucket_partitioning(bucket_dir):
47
46
return partitioning
48
47
49
48
49
+ def get_bucket_temporal_partitioning (bucket_dir ):
50
+ bucket_info = read_bucket_info (bucket_dir )
51
+ return bucket_info .get ("temporal_partitioning" )
52
+
53
+
50
54
def write_bucket_info (bucket_dir , partitioning ):
51
55
os .makedirs (bucket_dir , exist_ok = True )
52
56
bucket_info = partitioning .to_dict ()
53
57
bucket_info_filepath = os .path .join (bucket_dir , "bucket_info.yaml" )
54
58
write_yaml (bucket_info , filepath = bucket_info_filepath , sort_keys = False )
55
59
56
60
57
- ####------------------------------------------------------------------------------------------------------------------ .
61
+ ####---------------------------------------------------------------------------.
58
62
#### Bucket partitions utilities
59
63
60
64
@@ -105,3 +109,6 @@ def get_filepaths_by_partition(bucket_dir, parallel=True, file_extension=None, g
105
109
sep = os .path .sep
106
110
dict_partition_files = {sep .join (k .strip (sep ).split (sep )[- n_levels :]): v for k , v in dict_filepaths .items ()}
107
111
return dict_partition_files
112
+
113
+
114
+ ####---------------------------------------------------------------------------.
0 commit comments