dataconvert updates

This commit is contained in:
2026-09-16 09:07:07 -03:00
parent e05f8f1fca
commit 74e246e67a
3 changed files with 20 additions and 5 deletions

View File

@@ -29,6 +29,9 @@ def write_tables(dfs: dict, out_dir: Path, source_name: str, max_rows=None, repo
filename = table_filename(raw_name, source_name, len(dfs), bare_prefixes)
sql, total, full_bytes, exact = render_table(df, table, max_rows)
out_file = out_dir / filename
# Created on the first file, so a run that finds nothing to convert
# leaves no empty directory behind.
out_dir.mkdir(parents=True, exist_ok=True)
# Several sources can feed the same table; they accumulate in one file.
mode = "a" if out_file.exists() else "w"