From be929e59c01860b36c78aa60e8d5bde860657bdf Mon Sep 17 00:00:00 2001 From: Nassim Date: Tue, 10 Dec 2024 13:00:28 -0500 Subject: [PATCH 1/2] Makes meds-transform and polars requirements more flexible. --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 670abee..6e5a247 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,8 +15,8 @@ classifiers = [ "Operating System :: OS Independent", ] dependencies = [ - "polars==1.6.0", "pyarrow", "loguru", "hydra-core==1.3.2", "numpy", "scipy<1.14.0", "pandas", "tqdm", "xgboost", - "scikit-learn", "hydra-optuna-sweeper", "hydra-joblib-launcher", "ml-mixins", "meds==0.3.3", "meds-transforms==0.0.7", + "polars>=1.6.0,<=1.17.1", "pyarrow", "loguru", "hydra-core==1.3.2", "numpy", "scipy<1.14.0", "pandas", "tqdm", "xgboost", + "scikit-learn", "hydra-optuna-sweeper", "hydra-joblib-launcher", "ml-mixins", "meds>=0.3.3", "meds-transforms>=0.0.7", ] [tool.setuptools_scm] From 01c0a5200586fb31beea2d1f6e27b3bde9e54292 Mon Sep 17 00:00:00 2001 From: Nassim Date: Tue, 10 Dec 2024 13:19:24 -0500 Subject: [PATCH 2/2] update the mapper doctest to generalize to any polars version specific exception --- src/MEDS_tabular_automl/mapper.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/MEDS_tabular_automl/mapper.py b/src/MEDS_tabular_automl/mapper.py index 9870c50..243708a 100644 --- a/src/MEDS_tabular_automl/mapper.py +++ b/src/MEDS_tabular_automl/mapper.py @@ -163,10 +163,9 @@ def wrap( ... lambda df: df.with_columns(pl.col("c") * 2), ... lambda df: df.filter(pl.col("d") > 4) ... ] - >>> wrap(in_fp, out_fp, read_fn, write_fn, *transform_fns) - Traceback (most recent call last): - ... - polars.exceptions.ColumnNotFoundError: unable to find column "d"; valid columns: ["a", "b", "c"] + >>> import pytest + >>> with pytest.raises(Exception): + ... wrap(in_fp, out_fp, read_fn, write_fn, *transform_fns) >>> assert cache_directory.is_dir() >>> cache_fp = cache_directory / "step_0.output" >>> pl.read_csv(cache_fp)