Skip to content

Column matches is broken for dy.Enum #140

@MoritzPotthoffQC

Description

@MoritzPotthoffQC

Currently, matches fails when comparing Enum columns, apparently because polars identifies the column as a Series.

Minimum example:

import polars as pl
import dataframely as dy
column = dy.Enum(["foo"])
column.matches(column, pl.col("bar"))

Results in

TypeError: the truth value of a Series is ambiguous
                                                                                                                                 
Here are some things you might want to try:                                                                                      
- instead of `if s`, use `if not s.is_empty()`                                                                                   
- instead of `s1 and s2`, use `s1 & s2`                                                                                          
- instead of `s1 or s2`, use `s1 | s2`                                                                                           
- instead of `s in [y, z]`, use `s.is_in([y, z])`  

Afaict, this worked before #138, so maybe we need to look into that.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions