Describe the bug
The transform_new function of the scale transformer in the functime preprocessing module fails during execution. This issue arises when the function attempts to join the X DataFrame with the _mean DataFrame based on index columns (idx_cols) specified as 'time' and 'entity'. The join operation fails because _mean contains only the 'entity' column and lacks the 'time' column, leading to a key mismatch and an execution error.
To Reproduce
import polars as pl
from functime.preprocessing import scale
# Load sample data
y = pl.read_parquet("https://github.com/functime-org/functime/raw/main/data/commodities.parquet")
# Initialize the scale transformer
transformer = scale()
# Fit the transformer
_ = y.pipe(transformer).collect()
# Attempt to transform new data and observe the error
transformer.transform_new(y).collect()
Expected behavior
The function would only join on columns that are present in _mean.
Desktop (please complete the following information):
Describe the bug The
transform_new
function of the scale transformer in the functime preprocessing module fails during execution. This issue arises when the function attempts to join theX
DataFrame with the_mean
DataFrame based on index columns (idx_cols
) specified as 'time' and 'entity'. The join operation fails because_mean
contains only the 'entity' column and lacks the 'time' column, leading to a key mismatch and an execution error.To Reproduce
Expected behavior The function would only join on columns that are present in
_mean
.Desktop (please complete the following information):