Skip to content

Feature caching not cleared #352

@giovannivolpe

Description

@giovannivolpe

If a feature is called directly, its result is cached internally. This can affect how it behaves when reused in chained pipelines. For example:

stack_feature = dt.Stack(value=2)
_ = stack_feature(1) # Evaluate the feature and cache the output
(1 & stack_feature)()
[1, 1, 2]

To ensure consistent behavior when reusing a feature after calling it, reset its state using instead:

stack_feature = dt.Stack(value=2)
_ = stack_feature(1)
stack_feature.update() # clear cached state
(1 & stack_feature)()
[1, 2]

This should not happen and is probably a problem with the caching. The two calls should both produce [1, 2]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions