Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in transform_new Function Due to Index Column Mismatch in Scale Transformer #227

Open
jhug12 opened this issue Jun 7, 2024 · 1 comment · May be fixed by #228
Open

Error in transform_new Function Due to Index Column Mismatch in Scale Transformer #227

jhug12 opened this issue Jun 7, 2024 · 1 comment · May be fixed by #228
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jhug12
Copy link

jhug12 commented Jun 7, 2024

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):

  • OS: Ubuntu 22.04.4 LTS
  • Python version: 3.8.19
  • functime version: 0.9.5
@baggiponte
Copy link
Collaborator

Ciao and thanks for the bug report! Would also like ask you what Polars version you are running.

@baggiponte baggiponte added the bug Something isn't working label Jun 9, 2024
@baggiponte baggiponte added this to the 0.9.X milestone Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants