Skip to content

Commit

Permalink
convert literal type to its variants (#4062)
Browse files Browse the repository at this point in the history
  • Loading branch information
adhami3310 authored Oct 4, 2024
1 parent 9b5a368 commit 12b81ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions reflex/vars/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ def guess_type(self) -> Var:

return self

if fixed_type is Literal:
args = get_args(var_type)
fixed_type = unionize(*(type(arg) for arg in args))

if not inspect.isclass(fixed_type):
raise TypeError(f"Unsupported type {var_type} for guess_type.")

Expand Down

0 comments on commit 12b81ad

Please sign in to comment.