From 4cec9224e94efcd6e4ddbd789f1c8da7a2a3e248 Mon Sep 17 00:00:00 2001 From: David Gardner <96306125+dagardner-nv@users.noreply.github.com> Date: Tue, 2 May 2023 10:46:36 -0700 Subject: [PATCH] Fix race condition in CompareDataFrameStage (#935) * Fixes intermittent segfault in `CompareDataFrameStage` and `ValidationStage` Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Devin Robison (https://github.com/drobison00) - Christopher Harris (https://github.com/cwharris) URL: https://github.com/nv-morpheus/Morpheus/pull/935 --- .../stages/output/compare_dataframe_stage.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/morpheus/stages/output/compare_dataframe_stage.py b/morpheus/stages/output/compare_dataframe_stage.py index 0680523739..9afe3c7c4f 100644 --- a/morpheus/stages/output/compare_dataframe_stage.py +++ b/morpheus/stages/output/compare_dataframe_stage.py @@ -107,13 +107,15 @@ def get_results(self, clear=True) -> dict: if self._reset_index: combined_df.reset_index(inplace=True) + results = compare_df.compare_df(self._compare_df, + combined_df, + include_columns=self._include_columns, + exclude_columns=self._exclude_columns, + replace_idx=self._index_col, + abs_tol=self._abs_tol, + rel_tol=self._rel_tol) + if clear: self.clear() - return compare_df.compare_df(self._compare_df, - combined_df, - include_columns=self._include_columns, - exclude_columns=self._exclude_columns, - replace_idx=self._index_col, - abs_tol=self._abs_tol, - rel_tol=self._rel_tol) + return results