Skip to content

[BUG]: Static categorical/continuous features are not separated in v2 output #2261

@Chetansahney

Description

@Chetansahney

Describe the bug
In the tslib v2 data path, _TslibDataset.getitem returned the same processed_data["static"] tensor for both static_categorical_features and static_continuous_features. This mixes feature types and breaks expected static-input semantics for models that rely on separated categorical vs continuous static tensors.

To Reproduce

Python

Build a dataset with both:

- one static categorical feature

- one static continuous feature

Then inspect a batch from tslib v2 dataloader.

batch = next(iter(dataloader))
x, y = batch

print(x["static_categorical_features"].shape)
print(x["static_continuous_features"].shape)

before fix: both tensors came from the same source/static tensor

Expected behavior
static_categorical_features should contain only static categorical columns, and static_continuous_features should contain only static continuous columns, each with correct dimensions and no duplication/type leakage.

Additional context
Fix implemented in /home/runner/work/pytorch-forecasting/pytorch-forecasting/pytorch_forecasting/data/_tslib_data_module.py by splitting static features via metadata-defined indices.
Regression coverage added in /home/runner/work/pytorch-forecasting/pytorch-forecasting/tests/test_models/test_timexer_v2.py.

Versions
Repository: Chetansahney/pytorch-forecasting
Area: tslib v2 data module + Timexer v2 tests
Exact package/environment versions were not provided in this thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Needs triage & validation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions