-
Notifications
You must be signed in to change notification settings - Fork 164
__call__ function within models/_components/graphy.py passing parent function kwargs unintentionally #445
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
Comments
Hi @pablo-fence , thanks for reaching out! I hope I understand the issue correctly, but you are saying that if you do not provide keyword arguments, e.g. If that is the case I think I understand where the confusion comes from: Using a Did I understand you correctly? |
Hi @maxschulz-COL, Sorry I wasn't clear enough on my explanation; I understand the behavior of using a |
Understood - would it be possible to post a minimal working example that I can copy paste to debug. Currently it is a little difficult to patch things together and guess which are the important bits to keep. Then I will try to debug this ASAP. 💪 |
Of course, please find below:
Also, here is the requirements file I am using requirements.txt |
I figured out what is going on, and it took me a while 😄 There is one line missing: The problem is that the error message is super obscure, because there are a few things starting to mix. If you'd like to bear with me, here is the explanation:
TLDR: This is not a bug, just a typo in the script, but THANKS for raising that as it exposes a very confusing and obscure error message 🙏 Hope that makes sense 😄 P.S. We are soon merging the bug fix for your other question |
@maxschulz-COL great job debugging this. Agree this can be super confusing (as it is here) but I'm not immediately sure whether we'll be able to do anything that can fix it unfortunately 🤔 Other than changing our recommendation to be that you use @pablo-fence thanks for raising this indeed, and also for posting your dashboard here. It's always really interesting to see what people are doing with vizro, and this is a really cool example. Just a small question: for the parameter targets |
Oh, I see! That makes a lot of sense, many thanks @maxschulz-COL for looking into it so promptly - glad my (silly) mistake can be useful. P.S. Great! When it is, I should remove the line I added to return an empty dataframe up top my custom ag_grid function right? @antonymilne yes, I had to use strings since if I changed the options to boolean type:
the dashboard displays the dropdown like this (and clicking either cell has no effect) |
@pablo-fence thanks for checking the boolean parameter thing. This sounded familiar so I searched back through our git history and found that actually the right way to do this is:
This is explained in the note on the page https://vizro.readthedocs.io/en/stable/pages/user-guides/selectors/#categorical-selectors 🙂 @huong-li-nguyen since you did the original PR in https://github.com/McK-Internal/vizx-hyphen/pull/246 and I can't remember any more... Do you know why we still allow |
Thanks @antonymilne ! I see the default value with this implementation is the first |
Closed succesfully. Thank you @maxschulz-COL and @antonymilne !! 👍 |
Hmm, this seems to work ok for me like this:
Both with |
Description
Function call in
vizro/vizro-core/src/vizro/models/_components/graph.py
Line 54 in c043276
kwargs
from parent functionorigination_total
.Debugged including a print of
kwargs
in line 54 and got:where "'sum_count': 'Count', 'id_column': 'client_id', 'amount_column': 'outstanding_balance'}" are not expected in the function call.
Expected behavior
No response
Which package?
vizro
Package version
0.1.15
Python version
3.12.1
OS
MacOS Sonoma 14.4
How to Reproduce
I can't share the full repository due to privacy issues, but here is sample data that can be used to reproduce the issue:
and the function that generates the dashboard page:
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: