polars icon indicating copy to clipboard operation
polars copied to clipboard

Allow duplicate columns in sub-parts of the graph if the final result is valid

Open cBournhonesque opened this issue 1 week ago • 1 comments

Description

I am in a situation like so:

a = pl.LazyFrame({"a": [1, 2], "x": [3, 4]})
b = pl.LazyFrame({"b": [3, 4], "x": [5, 6]})
c = pl.concat([a, b], how='horizontal', strict=True)
d = c.select("a")

I have multiple intermediate LazyFrames with a duplicate column. I am concatenating these lazyframes, but at the end I'm only selecting from one of them. This fails because the intermediate LazyFrame is invalid (duplicate column), but column projection rules should mean that it doesn't matter.

Should this be something that is allowed?

cBournhonesque avatar Dec 09 '25 14:12 cBournhonesque

I don't think I want to open this can of worms.

orlp avatar Dec 09 '25 16:12 orlp