From a2e7a28ef9a5b79bc64af38e65cfc9c64edf427a Mon Sep 17 00:00:00 2001 From: Joan Gonzalez Date: Mon, 1 Jul 2024 10:21:37 -0300 Subject: [PATCH] Repad mapping ID --- data_transformers/consumer/update.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data_transformers/consumer/update.py b/data_transformers/consumer/update.py index 2c41faf..233b010 100644 --- a/data_transformers/consumer/update.py +++ b/data_transformers/consumer/update.py @@ -19,6 +19,10 @@ def df_csv_str(df): df.to_csv(buffer, index=False) return buffer.getvalue() +def repad_name(s: str): + left, right = s.split('_g') + return left + '_g' + str.zfill(str(right), 2) + class LazyAction: def __init__(self, f): self.f = f @@ -125,7 +129,7 @@ def main(subtopico, *args): 'target': ('argendata/graficos', f'{subtopico}/{p}/data/{p}.csv')} for k,v in mappings.items() for x in v - for p in (x['public'], ) # alias + for p in (repad_name(x['public']), ) # alias } for gid, v in workspace.items():