Skip to content

Commit

Permalink
Repad mapping ID
Browse files Browse the repository at this point in the history
  • Loading branch information
joangq committed Jul 1, 2024
1 parent 116deb0 commit a2e7a28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion data_transformers/consumer/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit a2e7a28

Please sign in to comment.