Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fully migrate vars into new system #3743

Merged
merged 48 commits into from
Aug 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
de1fbdb
fully migrate vars into new system
adhami3310 Aug 5, 2024
1eecd1f
i hate rufffff (no i don't)
adhami3310 Aug 5, 2024
450610a
fix silly pright issues (except colormode and state)
adhami3310 Aug 5, 2024
da95d0f
remove all instances of Var.create
adhami3310 Aug 5, 2024
c397cb2
create immutable callable var and get rid of more base vars
adhami3310 Aug 5, 2024
81cd679
implement hash for all functions
adhami3310 Aug 6, 2024
ea33c39
get reflex-web to compile
adhami3310 Aug 9, 2024
982e4c1
get it to compile reflex-web successfully
adhami3310 Aug 9, 2024
f6938cf
fix tests
adhami3310 Aug 12, 2024
0ae8831
fix pyi
adhami3310 Aug 12, 2024
4349d69
use override from typing_extension
adhami3310 Aug 12, 2024
854d729
put plotly inside of a catch
adhami3310 Aug 12, 2024
e0c4e97
dicts are unusable sadly
adhami3310 Aug 12, 2024
5bfc0c0
fix silly mistake
adhami3310 Aug 12, 2024
0fd4237
overload equals to special case immutable var
adhami3310 Aug 12, 2024
2c26dad
improve test_cond
adhami3310 Aug 12, 2024
2f49ce0
solve more CI issues, down to 94 failures
adhami3310 Aug 13, 2024
82a3498
down to 20 errors
adhami3310 Aug 14, 2024
39bc0c0
down to 13 errors
adhami3310 Aug 14, 2024
d516b3b
pass all testcases
adhami3310 Aug 14, 2024
e92218d
fix pyright issues
adhami3310 Aug 14, 2024
1d45f70
reorder things
adhami3310 Aug 14, 2024
777e8bc
use get origin more
adhami3310 Aug 14, 2024
75ef773
use fixed_type logic
adhami3310 Aug 15, 2024
8de75b7
various optimizations
adhami3310 Aug 15, 2024
1603e06
go back to passing test cases
adhami3310 Aug 15, 2024
9e1a35f
use less boilerplate
adhami3310 Aug 15, 2024
ab63e57
remove unnecessary print message
adhami3310 Aug 15, 2024
5a8ca04
remove weird comment
adhami3310 Aug 15, 2024
9deda27
add test for html issue
adhami3310 Aug 15, 2024
0ad21fe
add type ignore
adhami3310 Aug 15, 2024
4978b20
fix another silly issue
adhami3310 Aug 15, 2024
3d7ea37
override get all var data for var operations call
adhami3310 Aug 16, 2024
69f0d1d
make integration tests pass
adhami3310 Aug 16, 2024
85c1590
fix immutable call var
adhami3310 Aug 17, 2024
dd13dba
better logic for finding parent class
adhami3310 Aug 17, 2024
397683a
use even better logic for finding state wrt computedvar
adhami3310 Aug 17, 2024
bf1d052
only choose the ones that are defined in the same module
adhami3310 Aug 19, 2024
9fb4b67
small dict to large dict
adhami3310 Aug 19, 2024
26002a8
[REF-3591] Remove chakra-related files from immutable vars PR (#3821)
masenf Aug 22, 2024
02def8c
Merge branch 'main' into immutable-vars
masenf Aug 22, 2024
7d7f788
pyproject.toml: bump to 0.6.0a1
masenf Aug 23, 2024
8b51244
pyproject.toml: depend on reflex-chakra>=0.6.0a
masenf Aug 23, 2024
f09d2e2
Merge remote-tracking branch 'origin/main' into immutable-vars
masenf Aug 23, 2024
56f278d
poetry.lock: relock dependencies
masenf Aug 23, 2024
86563b6
integration: bump listening timeout to 1200 seconds
masenf Aug 23, 2024
a94eedf
integration: bump listening timeout to 1800 seconds
masenf Aug 23, 2024
650aa1b
Use cached_var_no_lock to avoid ImmutableVar deadlocks (#3835)
masenf Aug 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use get origin more
  • Loading branch information
adhami3310 committed Aug 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 777e8bc60ec9f2b161419ebc25ff280b6e234445
10 changes: 3 additions & 7 deletions reflex/ivars/base.py
Original file line number Diff line number Diff line change
@@ -362,13 +362,9 @@ def to(
from .object import ObjectVar, ToObjectOperation
from .sequence import ArrayVar, StringVar, ToArrayOperation, ToStringOperation

fixed_type = (
var_type
if var_type is None or inspect.isclass(var_type)
else get_origin(var_type)
)
fixed_type = get_origin(var_type) or var_type

fixed_output_type = output if inspect.isclass(output) else get_origin(output)
fixed_output_type = get_origin(output) or output

if fixed_output_type is dict:
return self.to(ObjectVar, output)
@@ -444,7 +440,7 @@ def guess_type(self) -> ImmutableVar:
if var_type is Any:
return self

fixed_type = var_type if inspect.isclass(var_type) else get_origin(var_type)
fixed_type = get_origin(var_type) or var_type

if fixed_type is Union:
return self
Loading
Oops, something went wrong.