def test_window_transformer_offset_parameter(self):
        """
        Test that the window parameter can support offset of pandas.Timedelta
        """
        base_parameters = {
            "function": "mean",
            "components": ["0"],
            "mode": "rolling",
        }

        offset_parameters = base_parameters.copy()
        offset_parameters.update({"window": pd.Timedelta(hours=4)})
        offset_transformer = WindowTransformer(
            transforms=offset_parameters,
        )
        offset_transformed = offset_transformer.transform(self.target_hourly)

        integer_parameters = base_parameters.copy()
        integer_parameters.update({"window": 4})
        integer_transformer = WindowTransformer(
            transforms=integer_parameters,
        )
        integer_transformed = integer_transformer.transform(self.target_hourly)
        np.testing.assert_equal(
            integer_transformed.values(), offset_transformed.values()
        )
        assert offset_transformed.components[0] == "rolling_mean_0 days 04:00:00_0"
        assert integer_transformed.components[0] == "rolling_mean_4_0"

        invalid_parameters = base_parameters.copy()
        invalid_parameters.update({"window": pd.DateOffset(hours=4)})
        invalid_transformer = WindowTransformer(
            transforms=invalid_parameters,
        )
        # if pd.DateOffset, raise ValueError of non-fixed frequency
        with pytest.raises(ValueError):
            invalid_transformer.transform(self.target_hourly)

        Test that the window parameter can support offset of pandas.Timedelta
        
darts/tests/dataprocessing/transformers/test_window_transformations.py