for child in [x for x in data_path.iterdir() if x.is_dir()]:
csvs = list(child.glob('*.csv'))
for csv in csvs:
table = parse_csv(csv)
if table:
table_cols = [x.lower() for x in table.column_names]
missing_pivot = []
for pivot in ['id_station', 'id_pdc', 'date_maj']:
if pivot not in table_cols:
missing_pivot.append(pivot)
if missing_pivot:
break # THIS LINE
for row in table.rows:
# stuff
The current code skips to the next directory when a pivot is missing. It shouldn't move to the next folder, just to the next CSV file. Hence, this PR.
Related code block in the notebook
The current code skips to the next directory when a pivot is missing. It shouldn't move to the next folder, just to the next CSV file. Hence, this PR.