Skip to content

Commit

Permalink
Merge pull request #325 from statisticsnorway/fix_output_order
Browse files Browse the repository at this point in the history
Fix output order
  • Loading branch information
osn-bip authored Feb 20, 2024
2 parents 7dde3a2 + 710526b commit 9512e93
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/altinn/flatten.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _make_angiver_row_df(file_path: str) -> pd.DataFrame:
"FELTVERDI": _extract_angiver_id(file_path),
"IDENT_NR": xml_dict[root_element]["InternInfo"]["enhetsIdent"],
"VERSION_NR": _extract_angiver_id(file_path),
"DELREGNR": xml_dict[root_element]["InternInfo"]["delregNr"],
"DELREG_NR": xml_dict[root_element]["InternInfo"]["delregNr"],
"ENHETS_TYPE": xml_dict[root_element]["InternInfo"]["enhetsType"],
"SKJEMA_ID": xml_dict[root_element]["InternInfo"]["raNummer"],
}
Expand Down Expand Up @@ -270,7 +270,7 @@ def isee_transform(

final_df["IDENT_NR"] = xml_dict[root_element]["InternInfo"]["enhetsIdent"]
final_df["VERSION_NR"] = _extract_angiver_id(file_path)
final_df["DELREGNR"] = xml_dict[root_element]["InternInfo"]["delregNr"]
final_df["DELREG_NR"] = xml_dict[root_element]["InternInfo"]["delregNr"]
final_df["ENHETS_TYPE"] = xml_dict[root_element]["InternInfo"]["enhetsType"]
final_df["SKJEMA_ID"] = xml_dict[root_element]["InternInfo"]["raNummer"]

Expand All @@ -293,6 +293,18 @@ def isee_transform(

final_df = _add_lopenr(final_df)

columns_order = [
"SKJEMA_ID",
"DELREG_NR",
"IDENT_NR",
"ENHETS_TYPE",
"FELTNAVN",
"FELTVERDI",
"VERSION_NR",
]

final_df = final_df[columns_order]

return final_df

else:
Expand Down

0 comments on commit 9512e93

Please sign in to comment.