Fix Pyright error: Operator "in" not supported for types "Literal['Dispatch__'] and "_T@filter"

Viewed 296

I have a line of code that keeps getting flagged by Pyright and I'm not sure how I would rewrite this line of code:

dispatch_vars = list(filter(lambda x: "Dispatch__" in x, df.columns))

And Pyright says:

[Pyright] Operator "in" not supported for types "Literal['Dispatch__']" and "_T@filter"

the code works as expected, so I'm not sure what it's trying to protect me against.

0 Answers
Related