Skip to content

pct_change is unable to find a column #22077

@coastalwhite

Description

@coastalwhite

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl
df = pl.DataFrame({
    'a': [1, 2, 3],
})
df.select(
    x = pl.col.a,                                           # This works.
    b = pl.Series([1, 2, 5, 2]).pct_change(pl.col.a.min()), # This returns a col `a` not found error.
)

Log output

ColumnNotFoundError: a

Resolved plan until failure:

	---> FAILED HERE RESOLVING 'sink' <---
DF [""]; PROJECT */1 COLUMNS

Issue description

For some reason, the column a cannot be found here.

Expected behavior

It is found.

Installed versions

Replace this line with the output of pl.show_versions(). Leave the backticks in place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageAwaiting prioritization by a maintainerpythonRelated to Python Polars

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions