Skip to content

Commit ef019c0

Browse files
committed
flatten: Fix combination of --use-titles and --rolup with a value on CLI
#359
1 parent c218eed commit ef019c0

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Identifier,Type,Name,Address,Coffee quality,Type of coke
2-
1,cafe,Cafe Open,,passable,
3-
2,pub,Pints R Us,,,pepsi
1+
Identifier,Type,Name,Address,Coffee quality,Type of coke,Owner:First name,Owner:Last name,Owner:Email
2+
1,cafe,Cafe Open,,passable,,Clark,Kent,[email protected]
3+
2,pub,Pints R Us,,,pepsi,Jim,Kirk,[email protected]

flattentool/json_input.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,15 @@ def parse_json_dict(
403403
elif (
404404
self.use_titles
405405
and parent_name + key in self.rollup
406-
and parent_name + key
406+
and self.schema_parser.sub_sheet_titles.get(
407+
(parent_name, key,)
408+
)
407409
in self.schema_parser.sub_sheets
408410
):
409411
relevant_subsheet = self.schema_parser.sub_sheets.get(
410-
parent_name + key
412+
self.schema_parser.sub_sheet_titles.get(
413+
(parent_name, key,)
414+
)
411415
)
412416
if relevant_subsheet is not None:
413417
rollup_field_title = sheet_key_title(

0 commit comments

Comments
 (0)