diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0ef27d..7d239eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: - { PYTHON_VERSION: 'python=3.9', POLARS_VERSION: 'polars=0.16' } - { PYTHON_VERSION: 'python=3.9', POLARS_VERSION: 'polars=0.17' } - { PYTHON_VERSION: 'python=3.9', POLARS_VERSION: 'polars=0.18' } + - { PYTHON_VERSION: 'python=3.9', POLARS_VERSION: 'polars=0.19' } - { PYTHON_VERSION: 'python=3.10', POLARS_VERSION: '' } - { PYTHON_VERSION: 'python=3.11', POLARS_VERSION: '' } steps: diff --git a/README.md b/README.md index 4457aa3..27f89e7 100644 --- a/README.md +++ b/README.md @@ -170,17 +170,17 @@ To get a more detailed understanding of what's happening under the hood, check o ### conda ```bash -$ conda install -c conda-forge polarify +conda install -c conda-forge polarify # or micromamba -$ micromamba install -c conda-forge polarify +micromamba install -c conda-forge polarify # or pixi -$ pixi add polarify +pixi add polarify ``` ### pip ```bash -$ pip install polarify +pip install polarify ``` ## ⚠️ Limitations @@ -211,8 +211,8 @@ TODO: Add some benchmarks ## 📥 Development installation -``` -$ pixi install -$ pixi run postinstall -$ pixi run test +```bash +pixi install +pixi run postinstall +pixi run test ``` diff --git a/pixi.toml b/pixi.toml index 31a28a1..30aa7ad 100644 --- a/pixi.toml +++ b/pixi.toml @@ -2,7 +2,7 @@ # https://github.com/prefix-dev/pixi/issues/79 [project] name = "polarify" -version = "0.1.2" +version = "0.1.3" description = "Simplifying conditional Polars Expressions with Python 🐍 🐻‍❄️" authors = ["Bela Stoyan ", "Pavel Zwerschke "] channels = ["conda-forge"] @@ -16,7 +16,7 @@ lint = "pre-commit run --all" [dependencies] python = ">=3.9" pip = "*" -polars = ">=0.14.24,<0.19" +polars = ">=0.14.24,<0.20" # build hatchling = "*" # test diff --git a/pyproject.toml b/pyproject.toml index d840dca..d654c07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "polarify" description = "Simplifying conditional Polars Expressions with Python 🐍 🐻‍❄️" -version = "0.1.2" +version = "0.1.3" readme = "README.md" license = "MIT" requires-python = ">=3.9" @@ -20,7 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "polars >=0.14.24,<0.19", + "polars >=0.14.24,<0.20", ] [project.urls] diff --git a/tests/test_parse_body.py b/tests/test_parse_body.py index 0830163..237e924 100644 --- a/tests/test_parse_body.py +++ b/tests/test_parse_body.py @@ -50,8 +50,16 @@ def test_funcs(request): def test_transform_function(df: polars.DataFrame, test_funcs): x = polars.col("x") transformed_func, original_func = test_funcs + + if pl_version < Version("0.19.0"): + df_with_transformed_func = df.select(transformed_func(x).alias("apply")) + df_with_applied_func = df.apply(lambda r: original_func(r[0])) + else: + df_with_transformed_func = df.select(transformed_func(x).alias("map")) + df_with_applied_func = df.map_rows(lambda r: original_func(r[0])) + assert_frame_equal( - df.select(transformed_func(x).alias("apply")), - df.apply(lambda r: original_func(r[0])), + df_with_transformed_func, + df_with_applied_func, check_dtype=False, )