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

Listing exchange keys not found instead of erroring in SDF #746

Closed
romainsacchi opened this issue Mar 13, 2022 · 5 comments
Closed

Listing exchange keys not found instead of erroring in SDF #746

romainsacchi opened this issue Mar 13, 2022 · 5 comments
Labels
bug Issues/PRs related to bugs data imports Issues related to importing data

Comments

@romainsacchi
Copy link

assert df.loc[:, EXCHANGE_KEYS].notna().all().all(), "Cannot find all keys."

Would it be better to print the list of exchanges not found in a popup window and maybe drop them and go on with the calculation, instead of throwing an error?
I think the error message may not be super clear to the user, plus it would not know what the faulty exchanges are.
I had to modify the code to make it export df to find out what the missing keys were.

@marc-vdm

This comment was marked as resolved.

@simb-sdu

This comment was marked as off-topic.

@marc-vdm
Copy link
Member

marc-vdm commented Mar 22, 2022

@romainsacchi Agree, I think we'll be seeing this issue more and more with more users using scenarios.

If you think the solution you wrote was good, feel free to make it a PR. Otherwise, making it a draft PR so I have an example of your ideas and can make something permanent would be nice. If you don't have the time, I'd be happy to take this over partially, if you can put some mockup in paint of what you'd like to see for example would already be really helpful!

I think there are a few things to consider:

  1. We should run this check when calculate is pressed, as the reference flows can still change after scenarios are loaded. This is probably too expensive to check every time a ref. flow is changed.
  2. Showing all missing exchanges may not be wise, as there could be 100K+, perhaps we should show the top 10 df.head and the total amount len(df[df.loc[:, EXCHANGE_KEYS].notna()]) of broken exchanges. Though a table is still something that will take a lot of space to properly show.
  3. We could perhaps tooltip some troubleshooting suggestions like checking database names (and please suggest more options, you may have some more trouble shooting experience here).

@marc-vdm
Copy link
Member

@romainsacchi As a temporary fix, we now tell users how many of the total exchanges are broken.

assert _df.all().all(), "Cannot find all keys. {} of {} exchanges are broken.".format(len(df[_df]),

@Zoophobus Zoophobus added bug Issues/PRs related to bugs data imports Issues related to importing data labels Feb 9, 2023
@Zoophobus Zoophobus mentioned this issue May 10, 2023
2 tasks
@Zoophobus Zoophobus mentioned this issue Aug 30, 2023
3 tasks
@marc-vdm
Copy link
Member

Closing this as resolved in #1025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues/PRs related to bugs data imports Issues related to importing data
Projects
None yet
Development

No branches or pull requests

4 participants