diff --git a/python/morpheus/morpheus/utils/column_info.py b/python/morpheus/morpheus/utils/column_info.py index eaef229666..80f9a73db3 100644 --- a/python/morpheus/morpheus/utils/column_info.py +++ b/python/morpheus/morpheus/utils/column_info.py @@ -469,9 +469,9 @@ def _process_column(self, df: pd.DataFrame) -> pd.Series: The processed column as a string Series. """ - first_col = df[self.input_columns[0]] + first_col = df[self.input_columns[0]].astype(str) - return first_col.str.cat(others=df[self.input_columns[1:]], sep=self.sep) + return first_col.str.cat(others=df[self.input_columns[1:]].astype(str), sep=self.sep) @dataclasses.dataclass diff --git a/tests/test_column_info.py b/tests/test_column_info.py index c40e7854ac..f117ca9d9f 100644 --- a/tests/test_column_info.py +++ b/tests/test_column_info.py @@ -149,8 +149,11 @@ def test_string_cat_column(): ], sep=", ") - with pytest.raises(Exception): - string_cat_col_with_int._process_column(df) + actual = string_cat_col_with_int._process_column(df) + + expected = pd.Series(["New York, 10001", "Dallas, 75001", "Austin, 73301"]) + + assert actual.equals(expected) @pytest.mark.use_python