diff --git a/config.py b/config.py index 3bb75a4..1f5c37b 100644 --- a/config.py +++ b/config.py @@ -211,13 +211,22 @@ def year_to_partition_name(year: int, table: str) -> str: if table_upper == "RAWDATACOR": # RAWDATACOR: 2014-2024 (part0-part10) + # RAWDATACOR: 2025-2030 (d12-d17) + if year < 2014: year = 2014 - elif year > 2024: - year = 2024 + elif year > 2030: + year = 2030 + + if year < 2025: + suffix = "part" + d_year = 2014 + else: + suffix = "d" + d_year = 2013 # Continue naming as d12, d13, ... - partition_index = year - 2014 # 2014→0, 2015→1, ..., 2024→10 - return f"part{partition_index}" + partition_index = year - d_year # 2014→0, 2015→1, ..., 2024→10 - 2025→12, ..., 2030→17 + return f"{suffix}{partition_index}" elif table_upper == "ELABDATADISP": # ELABDATADISP: 2013-2031 (d0-d18) @@ -245,16 +254,16 @@ def get_partitions_from_year(year: int, table: str) -> list[str]: Example: get_partitions_from_year(2022, "RAWDATACOR") - → ["part8", "part9", "part10"] # 2022→8, 2023→9, 2024→10 (stop at latest) + → ["part8", "part9", "part10", "d12", "d13", "d14", "d15", "d16", "d17"] # 2022→part8, ..., 2024→part10, 2025→d12, ..., 2030→d17 get_partitions_from_year(2025, "ELABDATADISP") - → ["d12", "d13", "d14", "d15", "d16", "d17", "d18"] # 2025-2031 + → ["d12", "d13", "d14", "d15", "d16", "d17"] # 2025-2030 """ table_upper = table.upper() partitions = [] if table_upper == "RAWDATACOR": - end_year = 2024 # RAWDATACOR: part0-part10 (2014-2024) + end_year = 2030 # RAWDATACOR: part0-part10 (2014-2024) + d12-d17 (2025-2030) elif table_upper == "ELABDATADISP": end_year = 2030 # ELABDATADISP: d0-d17 (2013-2030) else: