Skip to content

[REF-3160] fix rx.Var._replace raise TypeError on invalid kwargs - #3625

Merged
masenf merged 4 commits into
reflex-dev:mainfrom
jishnundth:fix/var-replace
Jul 9, 2024
Merged

masenf merged 4 commits into
reflex-dev:mainfrom
jishnundth:fix/var-replace

Conversation

@jishnundth

@jishnundth jishnundth commented Jul 4, 2024 •

Copy link
Copy Markdown
Contributor

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)

rx.Var._replace will raise TypeError, if any invalid kwargs are passed to the function, apart from the Var class attributes.

closes #3531

@benedikt-bartscher

Copy link
Copy Markdown
Contributor

@Jishnu-Nandhiath i think reflex.vars.ComputedVar needs the same error handling

@jishnundth

Copy link
Copy Markdown
Contributor Author

@benedikt-bartscher yeah, seems like it. Will add if necessary

@Lendemor

Lendemor commented Jul 5, 2024

Copy link
Copy Markdown
Contributor

@benedikt-bartscher yeah, seems like it. Will add if necessary

I think you can add it yeah.

Also you'll need to run pre-commit to pass the one CI check that is failing.

@jishnundth

Copy link
Copy Markdown
Contributor Author

Ok. I'll add it then. Yeah, forgot to pre-commit last time

@masenf masenf changed the title fix rx.Var._replace raise TypeError on invalid kwargs [REF-3160] fix rx.Var._replace raise TypeError on invalid kwargs Jul 8, 2024
@masenf
masenf merged commit 690b719 into reflex-dev:main Jul 9, 2024
Alek99 pushed a commit that referenced this pull request Jul 15, 2024
* fix: unexpected kwargs raise type error, on _replace

* add: docstring for _replace, test for invalid kwargs replace

* add: parametrize var for replace test

* fix: computed_var _replace with invalid kwargs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REF-3160] [VarOps] It is way too easy to pass incorrect kwargs to rx.Var._replace

4 participants