Skip to content

Commit

Permalink
Merge pull request #345 from statisticsnorway/vst_checkbox
Browse files Browse the repository at this point in the history
Moved checkbox-flattening in flatten.py
  • Loading branch information
vidstra authored Apr 19, 2024
2 parents bdad022 + 199bbd0 commit 13f3fb4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/altinn/flatten.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,6 @@ def isee_transform(

final_df = pd.concat([final_df, tag_df], axis=0, ignore_index=True)

if checkbox_vars is not None:
for checkbox_var in checkbox_vars:
final_df = _transform_checkbox_var(
final_df, checkbox_var, unique_code
)

final_df["IDENT_NR"] = xml_dict[root_element]["InternInfo"]["enhetsIdent"]
final_df["VERSION_NR"] = _extract_angiver_id(file_path)
final_df["DELREG_NR"] = xml_dict[root_element]["InternInfo"]["delregNr"]
Expand All @@ -361,6 +355,12 @@ def isee_transform(

final_df["LEVELS"] = final_df.apply(_create_levels_col, axis=1)

if checkbox_vars is not None:
for checkbox_var in checkbox_vars:
final_df = _transform_checkbox_var(
final_df, checkbox_var, unique_code
)

if mapping is not None:
final_df["FELTNAVN"] = final_df["FELTNAVN"].replace(mapping)

Expand Down

0 comments on commit 13f3fb4

Please sign in to comment.