From 86b2775508d43f532a77f0ef7cc2a0a503c15c6a Mon Sep 17 00:00:00 2001 From: grindsa Date: Sun, 22 Dec 2024 19:44:57 +0100 Subject: [PATCH] [fix] #74 - CLI transactions command cannot handle optional columns in CSV output --- dkb_robo/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dkb_robo/cli.py b/dkb_robo/cli.py index 545bd67..3e93698 100644 --- a/dkb_robo/cli.py +++ b/dkb_robo/cli.py @@ -235,7 +235,7 @@ def _load_format(output_format): def formatter(data): # pragma: no cover if len(data) == 0: return - writer = csv.DictWriter(sys.stdout, data[0].keys()) + writer = csv.DictWriter(sys.stdout, fieldnames=data[0].keys(), restval="", extrasaction="ignore") writer.writeheader() writer.writerows(data)