Repository: sktime/sktime
Pull request #6222 (2024-03-27 14:48:57)

[MNT] update `temporian` bound to `<0.9.0,!=0.8.0`
This PR raises the upper `temporian` bound to `<0.9.0`, and adds an exclude for the `0.8.0` version that crashes the envs.

For now, used only for testing dependency compatibility.


Patch:
diff --git a/pyproject.toml b/pyproject.toml
index d60b99911..c4f47f25c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -108,7 +108,7 @@ all_extras = [
   "statsmodels>=0.12.1",
   'stumpy>=1.5.1; python_version < "3.11"',
   'tbats>=1.1; python_version < "3.12"',
-  'temporian<0.8.0,>=0.7.0; python_version < "3.12" and sys_platform != "win32"',
+  'temporian<0.9.0,>=0.7.0,!=0.8.0; python_version < "3.12" and sys_platform != "win32"',
   'tensorflow<2.17,>=2; python_version < "3.12"',
   'tsbootstrap<0.2,>=0.1.0',
   'tsfresh>=0.17; python_version < "3.12"',
@@ -147,7 +147,7 @@ all_extras_pandas2 = [
   "statsmodels>=0.12.1",
   'stumpy>=1.5.1; python_version < "3.11"',
   'tbats>=1.1; python_version < "3.12"',
-  'temporian<0.8.0,>=0.7.0; python_version < "3.12" and sys_platform != "win32"',
+  'temporian<0.9.0,>=0.7.0,!=0.8.0; python_version < "3.12" and sys_platform != "win32"',
   'tensorflow<2.17,>=2; python_version < "3.12"',
   'tsbootstrap<0.2,>=0.1.0',
   'tsfresh>=0.17; python_version < "3.12"',
@@ -214,7 +214,7 @@ transformations = [
   "pykalman<0.10,>=0.9.5",
   "statsmodels<0.15,>=0.12.1",
   'stumpy<1.13,>=1.5.1; python_version < "3.12"',
-  'temporian<0.8.0,>=0.7.0; python_version < "3.12" and sys_platform != "win32"',
+  'temporian<0.9.0,>=0.7.0,!=0.8.0; python_version < "3.12" and sys_platform != "win32"',
   'tsbootstrap<0.2,>=0.1.0',
   'tsfresh<0.21,>=0.17; python_version < "3.12"',
 ]
diff --git a/sktime/transformations/bootstrap/_tsbootstrap.py b/sktime/transformations/bootstrap/_tsbootstrap.py
index 695a57b9a..af3d2fb07 100644
--- a/sktime/transformations/bootstrap/_tsbootstrap.py
+++ b/sktime/transformations/bootstrap/_tsbootstrap.py
@@ -119,16 +119,18 @@ class TSBootstrapAdapter(BaseTransformer):
         from sktime.utils.validation._dependencies import _check_soft_dependencies
 
         deps = cls.get_class_tag("python_dependencies")
-        _check_soft_dependencies(deps, severity="error")
 
-        from tsbootstrap import BlockBootstrap, MovingBlockBootstrap
+        if _check_soft_dependencies(deps, severity="none"):
+            from tsbootstrap import BlockBootstrap, MovingBlockBootstrap
 
-        params = [
-            {"bootstrap": BlockBootstrap(n_bootstraps=10)},
-            {
-                "bootstrap": MovingBlockBootstrap(n_bootstraps=10, block_length=4),
-                "include_actual": True,
-            },
-        ]
+            params = [
+                {"bootstrap": BlockBootstrap(n_bootstraps=10)},
+                {
+                    "bootstrap": MovingBlockBootstrap(n_bootstraps=10, block_length=4),
+                    "include_actual": True,
+                },
+            ]
+        else:
+            params = {"bootstrap": "dummy"}
 
         return params


Test patch:
diff --git a/sktime/tests/test_softdeps.py b/sktime/tests/test_softdeps.py
index 39f0e4bac..e35468df4 100644
--- a/sktime/tests/test_softdeps.py
+++ b/sktime/tests/test_softdeps.py
@@ -47,17 +47,6 @@ MODULES_TO_IGNORE = ("sktime._contrib", "sktime.utils._testing")
 EXCEPTED_FROM_NO_DEP_CHECK = []
 
 
-# estimators excepted from checking that get_test_params does not import soft deps
-# this is ok, in general, for adapters to soft dependency frameworks
-# since such adapters will import estimators from the adapted framework
-EXCEPTED_FROM_GET_PARAMS_CHECK = [
-    "PyODAnnotator",  # adapters always require soft dep. Here: pyod
-    "HCrystalBallAdapter",  # adapters always require soft dep. Here: hcrystalball
-    "TSBootstrapAdapter",  # adapters always require soft dep. Here: tsbootstrap
-    "TemporianTransformer",  # adapters always require soft dep. Here: temporian
-]
-
-
 def _is_test(module):
     module_parts = module.split(".")
     return any(part in ("tests", "test") for part in module_parts)
@@ -271,9 +260,6 @@ def test_est_construct_if_softdep_available(estimator):
 @pytest.mark.parametrize("estimator", all_ests)
 def test_est_get_params_without_modulenotfound(estimator):
     """Test that estimator test parameters do not rely on soft dependencies."""
-    if estimator.__name__ in EXCEPTED_FROM_GET_PARAMS_CHECK:
-        return None
-
     try:
         estimator.get_test_params()
     except ModuleNotFoundError as e:
@@ -282,6 +268,10 @@ def test_est_get_params_without_modulenotfound(estimator):
             f"Estimator {estimator.__name__} requires soft dependencies for parameters "
             f"returned by get_test_params. Test parameters should not require "
             f"soft dependencies and use only sktime internal objects. "
+            f"In a case where soft dependencies are required, return a shorter list, "
+            f"or an empty dict, with parameter sets that do not require soft "
+            f"dependencies, gated by a dependency check, for instance using "
+            f"skbase.utils.dependencies_check_soft_dependencies with severity='none'. "
             f"Exception text: {error_msg}"
         ) from e