Repository: ESMValGroup/ESMValCore

Issue:
Recipes fails with invalid regridding scheme `linear_extrapolate`
**Describe the bug**

See https://app.circleci.com/pipelines/github/ESMValGroup/ESMValTool/11191/workflows/e5b73b45-26f1-491b-99d6-b3bbcec2c442/jobs/71774.

I forgot to properly deprecate the regridding scheme `linear_extrapolate` in the recipe checks (only did that in the preprocessor itself), which causes some nightly tests to fail.

Will fix that now.

Discussion:

Patch:
diff --git a/esmvalcore/_recipe/check.py b/esmvalcore/_recipe/check.py
index f3de14e2a..9b4b2abb3 100644
--- a/esmvalcore/_recipe/check.py
+++ b/esmvalcore/_recipe/check.py
@@ -506,6 +506,13 @@ def regridding_schemes(settings: dict):
     # Check built-in regridding schemes (given as str)
     if isinstance(scheme, str):
         scheme = settings['regrid']['scheme']
+
+        # Also allow deprecated 'linear_extrapolate' scheme (the corresponding
+        # deprecation warning will be raised in the regrid() preprocessor)
+        # TODO: Remove in v2.13.0
+        if scheme == 'linear_extrapolate':
+            return
+
         allowed_regridding_schemes = list(
             set(
                 list(HORIZONTAL_SCHEMES_IRREGULAR) +


Test patch:
diff --git a/tests/integration/recipe/test_recipe.py b/tests/integration/recipe/test_recipe.py
index f93557f93..f8c6c3535 100644
--- a/tests/integration/recipe/test_recipe.py
+++ b/tests/integration/recipe/test_recipe.py
@@ -2884,6 +2884,7 @@ def test_invalid_builtin_regridding_scheme(
           test:
             regrid:
               scheme: INVALID
+              target_grid: 2x2
         diagnostics:
           diagnostic_name:
             variables:
@@ -2914,6 +2915,7 @@ def test_generic_regridding_scheme_no_ref(
             regrid:
               scheme:
                 no_reference: given
+              target_grid: 2x2
         diagnostics:
           diagnostic_name:
             variables:
@@ -2945,6 +2947,7 @@ def test_invalid_generic_regridding_scheme(
             regrid:
               scheme:
                 reference: invalid.module:and.function
+              target_grid: 2x2
         diagnostics:
           diagnostic_name:
             variables:
@@ -2966,3 +2969,25 @@ def test_invalid_generic_regridding_scheme(
         get_recipe(tmp_path, content, session)
     assert str(rec_err_exp.value) == INITIALIZATION_ERROR_MSG
     assert msg in str(rec_err_exp.value.failed_tasks[0].message)
+
+
+def test_deprecated_regridding_scheme(tmp_path, patched_datafinder, session):
+    content = dedent("""
+        preprocessors:
+          test:
+            regrid:
+              scheme: linear_extrapolate
+              target_grid: 2x2
+        diagnostics:
+          diagnostic_name:
+            variables:
+              tas:
+                mip: Amon
+                preprocessor: test
+                timerange: '2000/2010'
+                additional_datasets:
+                  - {project: CMIP5, dataset: CanESM2, exp: amip,
+                     ensemble: r1i1p1}
+            scripts: null
+        """)
+    get_recipe(tmp_path, content, session)