From 8c3c8c2c9f17b1a5c81dafc5ba919123f90c13dd Mon Sep 17 00:00:00 2001 From: "Uyanik, Yusuf" Date: Wed, 20 Dec 2023 15:28:15 +0100 Subject: [PATCH] improve polars patch PR --- examples/articles/ADMExplained.ipynb | 4 ++-- python/pdstools/valuefinder/ValueFinder.py | 2 +- python/requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/articles/ADMExplained.ipynb b/examples/articles/ADMExplained.ipynb index 1fc3c52d..feeaf90f 100644 --- a/examples/articles/ADMExplained.ipynb +++ b/examples/articles/ADMExplained.ipynb @@ -641,12 +641,12 @@ " pl.col(\"Contents\").cast(pl.Utf8)\n", " ).with_columns(\n", " pl.when(pl.col(\"Type\") == \"numeric\")\n", - " .then(pl.col(\"Contents\").apply(lambda col: extract_numbers_in_contents(col, 0)))\n", + " .then(pl.col(\"Contents\").map_elements(lambda col: extract_numbers_in_contents(col, 0)))\n", " .otherwise(pl.lit(-9999))\n", " .alias(\"BinLowerBound\")\n", " .cast(pl.Float32),\n", " pl.when(pl.col(\"Type\") == \"numeric\")\n", - " .then(pl.col(\"Contents\").apply(lambda col: extract_numbers_in_contents(col, 1)))\n", + " .then(pl.col(\"Contents\").map_elements(lambda col: extract_numbers_in_contents(col, 1)))\n", " .otherwise(pl.lit(-9999))\n", " .alias(\"BinUpperBound\")\n", " .cast(pl.Float32),\n", diff --git a/python/pdstools/valuefinder/ValueFinder.py b/python/pdstools/valuefinder/ValueFinder.py index 6e676111..5591c01b 100644 --- a/python/pdstools/valuefinder/ValueFinder.py +++ b/python/pdstools/valuefinder/ValueFinder.py @@ -110,7 +110,7 @@ def __init__( self.StageOrder = ( pl.DataFrame( {"pyStage": self.NBADStages}, - schema={"pyStage": pl.Categorical("physical")}, + schema={"pyStage": pl.Enum(self.NBADStages)}, ) .select(pl.col("pyStage")) .lazy() diff --git a/python/requirements.txt b/python/requirements.txt index d2b5690e..701d74f0 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -3,7 +3,7 @@ plotly>=5.5.0 requests pydot tqdm -polars>=0.20.0, <=0.20.1 +polars>=0.20.0, <0.21.0 pyarrow pyyaml aioboto3>=11.0