From 2302cf2a662b15097a64312b399b902c560d46c9 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Fri, 24 Sep 2021 12:09:29 -0700 Subject: [PATCH] shorten csv headers --- src/budget_sync/test/test_write_budget_csv.py | 4 ++-- src/budget_sync/write_budget_csv.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/budget_sync/test/test_write_budget_csv.py b/src/budget_sync/test/test_write_budget_csv.py index b412f08..a95a686 100644 --- a/src/budget_sync/test/test_write_budget_csv.py +++ b/src/budget_sync/test/test_write_budget_csv.py @@ -67,11 +67,11 @@ class TestWriteBudgetMarkdown(unittest.TestCase): [[!table format=csv file="/output_dir/milestone 2.csv"]]""", '/output_dir/milestone 1.csv': b"""\ -bug_id,budget_excluding_subtasks,budget_including_subtasks,fixed_budget_excluding_subtasks,fixed_budget_including_subtasks,submitted_excluding_subtasks,paid_excluding_subtasks,person1 (planned amt),person1 (req amt),person1 (req date),person1 (paid amt),person1 (paid date),person2 (planned amt),person2 (req amt),person2 (req date),person2 (paid amt),person2 (paid date) +bug_id,excl_subtasks,inc_subtasks,fixed_excl_subtasks,fixed_inc_subtasks,req_excl_subtasks,paid_excl_subtasks,person1 (planned amt),person1 (req amt),person1 (req date),person1 (paid amt),person1 (paid date),person2 (planned amt),person2 (req amt),person2 (req date),person2 (paid amt),person2 (paid date) 1,1000,1000,1000,1000,421,421,579,0,,0,,421,421,,421,2020-01-01 """, '/output_dir/milestone 2.csv': b"""\ -bug_id,budget_excluding_subtasks,budget_including_subtasks,fixed_budget_excluding_subtasks,fixed_budget_including_subtasks,submitted_excluding_subtasks,paid_excluding_subtasks +bug_id,excl_subtasks,inc_subtasks,fixed_excl_subtasks,fixed_inc_subtasks,req_excl_subtasks,paid_excl_subtasks """ }) # TODO: add more test cases diff --git a/src/budget_sync/write_budget_csv.py b/src/budget_sync/write_budget_csv.py index c040421..b67c50f 100644 --- a/src/budget_sync/write_budget_csv.py +++ b/src/budget_sync/write_budget_csv.py @@ -12,12 +12,12 @@ from budget_sync.write_budget_markdown import markdown_escape def _budget_csv_row(budget_graph: BudgetGraph, milestone: Milestone, node: Optional[Node]) -> Dict[str, str]: row_fns: Dict[str, Callable[[Node], Any]] = { 'bug_id': lambda node: node.bug.id, - 'budget_excluding_subtasks': lambda node: node.budget_excluding_subtasks, - 'budget_including_subtasks': lambda node: node.budget_including_subtasks, - 'fixed_budget_excluding_subtasks': lambda node: node.fixed_budget_excluding_subtasks, - 'fixed_budget_including_subtasks': lambda node: node.fixed_budget_including_subtasks, - 'submitted_excluding_subtasks': lambda node: node.submitted_excluding_subtasks, - 'paid_excluding_subtasks': lambda node: node.paid_excluding_subtasks, + 'excl_subtasks': lambda node: node.budget_excluding_subtasks, + 'inc_subtasks': lambda node: node.budget_including_subtasks, + 'fixed_excl_subtasks': lambda node: node.fixed_budget_excluding_subtasks, + 'fixed_inc_subtasks': lambda node: node.fixed_budget_including_subtasks, + 'req_excl_subtasks': lambda node: node.submitted_excluding_subtasks, + 'paid_excl_subtasks': lambda node: node.paid_excluding_subtasks, } milestone_people = budget_graph.milestone_people[milestone] -- 2.30.2