Repository: tinkoff-ai/etna (language: python)

Issue:
Teach `SpecialDaysTransform` to work on new segments
### 🚀 Feature Request

Currently, `SpecialDaysTransform` can't work on new segments, but in theory it can.

### Proposal

* Make `SpecialDaysTransform` not inherit from `PerSegmentWrapper`.


### Test cases

* Make sure that in `test_transforms/test_inference` tests on new segments are working.

### Additional context

_No response_


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 94f758900..2c3cec891 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Update requirements for `holidays` and `scipy`, change saving library from `pickle` to `dill` in `SaveMixin` ([#1268](https://github.com/tinkoff-ai/etna/pull/1268))
 - Update requirement for `ruptures`, add requirement for `sqlalchemy` ([#1276](https://github.com/tinkoff-ai/etna/pull/1276))
 - Optimize `make_samples` of `RNNNet` and `MLPNet` ([#1281](https://github.com/tinkoff-ai/etna/pull/1281))
+- Remove `to_be_fixed` from inference tests on `SpecialDaysTransform` ([#1283](https://github.com/tinkoff-ai/etna/pull/1283))
+- 
+- 
 - 
 ### Fixed
 - Fix `plot_backtest` and `plot_backtest_interactive` on one-step forecast ([1260](https://github.com/tinkoff-ai/etna/pull/1260))


Test patch:
diff --git a/tests/test_transforms/test_inference/test_inverse_transform.py b/tests/test_transforms/test_inference/test_inverse_transform.py
index 289737260..0e23db17b 100644
--- a/tests/test_transforms/test_inference/test_inverse_transform.py
+++ b/tests/test_transforms/test_inference/test_inverse_transform.py
@@ -691,6 +691,8 @@ def test_inverse_transform_train_new_segments(self, transform, dataset_name, exp
             (DensityOutliersTransform(in_column="target"), "ts_with_outliers"),
             (MedianOutliersTransform(in_column="target"), "ts_with_outliers"),
             (PredictionIntervalOutliersTransform(in_column="target", model=ProphetModel), "ts_with_outliers"),
+            # timestamp
+            (SpecialDaysTransform(), "regular_ts"),
         ],
     )
     def test_inverse_transform_train_new_segments_not_implemented(self, transform, dataset_name, request):
@@ -700,20 +702,6 @@ def test_inverse_transform_train_new_segments_not_implemented(self, transform, d
                 ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={}
             )
 
-    @to_be_fixed(raises=NotImplementedError, match="Per-segment transforms can't work on new segments")
-    @pytest.mark.parametrize(
-        "transform, dataset_name",
-        [
-            # timestamp
-            (SpecialDaysTransform(), "regular_ts"),
-        ],
-    )
-    def test_inverse_transform_train_new_segments_failed_not_implemented(self, transform, dataset_name, request):
-        ts = request.getfixturevalue(dataset_name)
-        self._test_inverse_transform_train_new_segments(
-            ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={}
-        )
-
 
 class TestInverseTransformFutureNewSegments:
     """Test inverse transform on future part of new segments.
@@ -1027,6 +1015,8 @@ def test_inverse_transform_future_new_segments(self, transform, dataset_name, ex
             (DensityOutliersTransform(in_column="target"), "ts_with_outliers"),
             (MedianOutliersTransform(in_column="target"), "ts_with_outliers"),
             (PredictionIntervalOutliersTransform(in_column="target", model=ProphetModel), "ts_with_outliers"),
+            # timestamp
+            (SpecialDaysTransform(), "regular_ts"),
         ],
     )
     def test_inverse_transform_future_new_segments_not_implemented(self, transform, dataset_name, request):
@@ -1036,20 +1026,6 @@ def test_inverse_transform_future_new_segments_not_implemented(self, transform,
                 ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={}
             )
 
-    @to_be_fixed(raises=NotImplementedError, match="Per-segment transforms can't work on new segments")
-    @pytest.mark.parametrize(
-        "transform, dataset_name",
-        [
-            # timestamp
-            (SpecialDaysTransform(), "regular_ts"),
-        ],
-    )
-    def test_inverse_transform_future_new_segments_failed_not_implemented(self, transform, dataset_name, request):
-        ts = request.getfixturevalue(dataset_name)
-        self._test_inverse_transform_future_new_segments(
-            ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={}
-        )
-
     @to_be_fixed(raises=Exception)
     @pytest.mark.parametrize(
         "transform, dataset_name, expected_changes",
diff --git a/tests/test_transforms/test_inference/test_transform.py b/tests/test_transforms/test_inference/test_transform.py
index f8f2d1014..d601f98d5 100644
--- a/tests/test_transforms/test_inference/test_transform.py
+++ b/tests/test_transforms/test_inference/test_transform.py
@@ -56,7 +56,6 @@
 from etna.transforms.decomposition import RupturesChangePointsModel
 from tests.test_transforms.test_inference.common import find_columns_diff
 from tests.utils import select_segments_subset
-from tests.utils import to_be_fixed
 
 # TODO: figure out what happened to TrendTransform
 
@@ -652,6 +651,8 @@ def test_transform_train_new_segments(self, transform, dataset_name, expected_ch
             (DensityOutliersTransform(in_column="target"), "ts_with_outliers"),
             (MedianOutliersTransform(in_column="target"), "ts_with_outliers"),
             (PredictionIntervalOutliersTransform(in_column="target", model=ProphetModel), "ts_with_outliers"),
+            # timestamp
+            (SpecialDaysTransform(), "regular_ts"),
         ],
     )
     def test_transform_train_new_segments_not_implemented(self, transform, dataset_name, request):
@@ -661,20 +662,6 @@ def test_transform_train_new_segments_not_implemented(self, transform, dataset_n
                 ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={}
             )
 
-    @to_be_fixed(raises=NotImplementedError, match="Per-segment transforms can't work on new segments")
-    @pytest.mark.parametrize(
-        "transform, dataset_name",
-        [
-            # timestamp
-            (SpecialDaysTransform(), "regular_ts"),
-        ],
-    )
-    def test_transform_train_new_segments_failed_not_implemented(self, transform, dataset_name, request):
-        ts = request.getfixturevalue(dataset_name)
-        self._test_transform_train_new_segments(
-            ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={}
-        )
-
 
 class TestTransformFutureNewSegments:
     """Test transform on future part of new segments.
@@ -981,6 +968,8 @@ def test_transform_future_new_segments(self, transform, dataset_name, expected_c
             (DensityOutliersTransform(in_column="target"), "ts_with_outliers"),
             (MedianOutliersTransform(in_column="target"), "ts_with_outliers"),
             (PredictionIntervalOutliersTransform(in_column="target", model=ProphetModel), "ts_with_outliers"),
+            # timestamp
+            (SpecialDaysTransform(), "regular_ts"),
         ],
     )
     def test_transform_future_new_segments_not_implemented(self, transform, dataset_name, request):
@@ -990,20 +979,6 @@ def test_transform_future_new_segments_not_implemented(self, transform, dataset_
                 ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={}
             )
 
-    @to_be_fixed(raises=NotImplementedError, match="Per-segment transforms can't work on new segments")
-    @pytest.mark.parametrize(
-        "transform, dataset_name",
-        [
-            # timestamp
-            (SpecialDaysTransform(), "regular_ts"),
-        ],
-    )
-    def test_transform_future_new_segments_failed_not_implemented(self, transform, dataset_name, request):
-        ts = request.getfixturevalue(dataset_name)
-        self._test_transform_future_new_segments(
-            ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={}
-        )
-
 
 class TestTransformFutureWithTarget:
     """Test transform on future dataset with known target.