From 12ec408fd1153d7c759ab94ff98d67357f66d555 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Thu, 12 Sep 2024 13:21:59 +0100 Subject: [PATCH 1/2] lisa.trace: Do not use pl.Expr.str on Categorical FIX pl.Expr.str namespace is exclusively reserved for the pl.String dtype. It should not be assumed that those expressions will work on Categorical dtype. Cast to String first and then back to Categorical. --- lisa/trace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisa/trace.py b/lisa/trace.py index 10a7c1ea2..20bea0f8d 100644 --- a/lisa/trace.py +++ b/lisa/trace.py @@ -2038,7 +2038,7 @@ class TxtTraceParserBase(TraceParserBase): elif event in ('ipi_entry', 'ipi_exit'): df = df.with_columns( - pl.col('reason').str.strip_chars('()') + pl.col('reason').cast(pl.String).str.strip_chars('()').cast(pl.Categorical) ) return df -- GitLab From 6afede06e5be9f7b2159d9956ee0f092b1d7105e Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Thu, 12 Sep 2024 13:31:57 +0100 Subject: [PATCH 2/2] setup.py: Change polars version bounds Since it is now known polars > 1.7.0 will fix the issue we faced, only avoid 1.7.0 rather than force to use lower versions. --- setup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index fc25979ca..536f6831b 100755 --- a/setup.py +++ b/setup.py @@ -136,10 +136,9 @@ if __name__ == "__main__": "holoviews >= 1.17", "panel", "colorcet", - # Force <1.7.0 until some issues are figured out: - # * problem on readthedocs - # * categorical issue: https://github.com/pola-rs/polars/issues/18717 - "polars >= 1.0.0, < 2.0.0, < 1.7.0", + # Avoid: + # polars 1.7.0: https://github.com/pola-rs/polars/issues/18719 + "polars >= 1.0.0, < 2.0.0, != 1.7.0", # Pandas >= 1.0.0 has support for new nullable dtypes # Pandas 1.2.0 has broken barplots: # https://github.com/pandas-dev/pandas/issues/38947 -- GitLab