Open MarcoGorelli opened 3 weeks ago
Actually, this matches what Polars does with
df = pl.DataFrame(data).with_columns(b=pl.col('a').dt.replace_time_zone('Asia/Katmandu'))
print(df.select(pl.selectors.by_dtype(pl.Datetime)))
The Polars way to do this would be:
df = pl.DataFrame(data).with_columns(b=pl.col('a').dt.replace_time_zone('Asia/Katmandu'))
print(df.select(pl.selectors.by_dtype(pl.Datetime, pl.Datetime(time_zone='*'))))
tbh I think it's a bit odd in Polars, I'd expect every variation of Datetime
to match by_dtype(pl.Datetime)
. I'll check if this is actually desirable / correct in Polars before moving forwards here
this outputs
For Polars, both columns 'a' and 'b' should be selected