Skip to content

Commit 3781682

Browse files
author
Priyadarshini Piramanayagam
committed
fix: resolve comments
1 parent 138ecb7 commit 3781682

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

nisystemlink/clients/testmonitor/utilities/_dataframe_utilities.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ def convert_results_to_dataframe(
3131
results_dataframe=normalized_dataframe
3232
)
3333
if set_id_as_index and "id" in normalized_dataframe.columns:
34-
normalized_dataframe = normalized_dataframe.set_index("id")
34+
normalized_dataframe.set_index("id", inplace=True)
3535

3636
return normalized_dataframe
3737

3838

3939
def __format_results_columns(results_dataframe: pd.DataFrame) -> pd.DataFrame:
40-
"""Format results column keep properties at the end.
40+
"""Format results column to keep properties at the end.
4141
4242
Args:
4343
results_dataframe: Dataframe of results.
@@ -46,7 +46,7 @@ def __format_results_columns(results_dataframe: pd.DataFrame) -> pd.DataFrame:
4646
Formatted dataframe of results.
4747
"""
4848
column_headers = results_dataframe.columns.to_list()
49-
formatted_column_headers = [
49+
standard_column_headers = [
5050
header for header in column_headers if __is_standard_column_header(header)
5151
]
5252
status_type_summary_header = [
@@ -57,13 +57,13 @@ def __format_results_columns(results_dataframe: pd.DataFrame) -> pd.DataFrame:
5757
properties_headers = [
5858
header for header in column_headers if __is_property_header(header=header)
5959
]
60-
formatted_column_headers += status_type_summary_header + properties_headers
60+
standard_column_headers += status_type_summary_header + properties_headers
6161

62-
return results_dataframe.reindex(columns=formatted_column_headers)
62+
return results_dataframe.reindex(columns=standard_column_headers, copy=False)
6363

6464

6565
def __is_standard_column_header(header: str) -> bool:
66-
"""Check if column header is not a status type summary or property.
66+
"""Check if column header is not status type summary or property.
6767
6868
Args:
6969
header: column header for results dataframe.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
class DataFrameHeaders:
2-
STATUS_TYPE_SUMMARY_HEADER_PREFIX = "status_type_summary"
2+
STATUS_TYPE_SUMMARY_HEADER_PREFIX = "status_type_summary."
33

44
PROPERTY_COLUMN_HEADER_PREFIX = "properties."

0 commit comments

Comments
 (0)