mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2026-01-23 14:42:56 +00:00
fix(seed): handle empty databases.csv and add unit tests
- Gracefully handle empty databases.csv by creating header columns and emitting a warning - Add _empty_df() helper for consistent DataFrame initialization - Add unit tests for baudolo-seed including empty-file regression case - Apply minor formatting fixes across backup and e2e test files https://chatgpt.com/share/69628f0b-8744-800f-b08d-2633e05167da
This commit is contained in:
@@ -52,7 +52,9 @@ def _atomic_write_cmd(cmd: str, out_file: str) -> None:
|
||||
execute_shell_command(f"mv {tmp} {out_file}")
|
||||
|
||||
|
||||
def fallback_pg_dumpall(container: str, username: str, password: str, out_file: str) -> None:
|
||||
def fallback_pg_dumpall(
|
||||
container: str, username: str, password: str, out_file: str
|
||||
) -> None:
|
||||
"""
|
||||
Perform a full Postgres cluster dump using pg_dumpall.
|
||||
"""
|
||||
@@ -103,9 +105,7 @@ def backup_database(
|
||||
"'*' is currently only supported for Postgres."
|
||||
)
|
||||
|
||||
cluster_file = os.path.join(
|
||||
out_dir, f"{instance_name}.cluster.backup.sql"
|
||||
)
|
||||
cluster_file = os.path.join(out_dir, f"{instance_name}.cluster.backup.sql")
|
||||
fallback_pg_dumpall(container, user, password, cluster_file)
|
||||
produced = True
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user