How do I fix this Python typing error? `daft/expre...
# daft-dev
c
How do I fix this Python typing error?
daft/expressions/expressions.py:272: *error:* Function "daft.expressions.expressions.Expression.str" is not valid as a type  [valid-type]
The line in question:
def to_struct(*inputs: Expression | str) -> Expression:
k
Can you try
Union[Expression, str]
?
I think older python versions don't support
|
to union types
c
Commit hook still fails, and with a new error saying to use
|
instead
k
hm nvm then
oh did you import
Expression.str
by accident
c
Oh that could be it, I’m in
expressions.py
j
I think you need
builtins.str
because the
str
name is overridden in that file
c
Yep that worked, thanks!
j
🔥