Skip to content

Feature caching not cleared #352

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]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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