diff --git a/ui/sdk/src/hamilton_sdk/tracking/polars_col_stats.py b/ui/sdk/src/hamilton_sdk/tracking/polars_col_stats.py index bb7e43232..cc2f74dd3 100644 --- a/ui/sdk/src/hamilton_sdk/tracking/polars_col_stats.py +++ b/ui/sdk/src/hamilton_sdk/tracking/polars_col_stats.py @@ -147,7 +147,7 @@ def datetime_column_stats( def str_len(col: pl.Series) -> pl.Series: - return col.str.lengths() + return col.str.len_chars() def avg_str_len(str_len: pl.Series) -> float: diff --git a/ui/sdk/tests/tracking/test_polars_col_stats.py b/ui/sdk/tests/tracking/test_polars_col_stats.py index 05a54d85a..a20e79385 100644 --- a/ui/sdk/tests/tracking/test_polars_col_stats.py +++ b/ui/sdk/tests/tracking/test_polars_col_stats.py @@ -108,3 +108,7 @@ def test_min_string(example_df_string): def test_max_string(example_df_string): assert pcs.max(example_df_string["a"]) == "e" + + +def test_str_len(example_df_string): + assert pcs.str_len(example_df_string["a"]).to_list() == [1, 1, 1, 1, 1]