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

clearer errors when missing functions #159

Closed
edublancas opened this issue Feb 24, 2023 · 2 comments · Fixed by #441
Closed

clearer errors when missing functions #159

edublancas opened this issue Feb 24, 2023 · 2 comments · Fixed by #441
Assignees

Comments

@edublancas
Copy link

Our plotting API requires some functions to be available in the database; for example, we use the percentile_disc function to calculate percentiles. Unfortunately, some databases do not have these functions, so when users run them, they'll sometimes see unclear errors.

We have two options here: either raise an error when a user runs one of these functions and is using a database that does not have support for it (e.g., MySQL and percentile_disc) or capture the errors and hint the user that the problem might be that the function isn't available.

The problem with the first approach is that we'd have to check the documentation for each major database and map all the unavailable functions; this gets tricky since those functions might be available via external packages. So the second alternative sounds better.

We could catch errors when executing our plotting functions and add a message at the end of the original message displayed by the database to hint to the user.

Example:

[Error from the database]

Ensure that the [some function] is available on [driver name]
If you need help [slack link]
@neelasha23
Copy link

neelasha23 commented Apr 21, 2023

Acceptance criteria:

  1. try except block around plotting functions (need to check which functions other than percentile_disc)
  2. original message + custom message(Ensure that the [some function] is available on [driver name]. If you need help [slack link])
  3. Telemetry call
  4. Unit tests for error + telemetry (Already present)
  5. Changelog entry
  6. document plots if not added already

@idomic @edublancas

@idomic
Copy link

idomic commented Apr 21, 2023

We have two options here: either raise an error when a user runs one of these functions and is using a database that does not have support for it (e.g., MySQL and percentile_disc) or capture the errors and hint the user that the problem might be that the function isn't available.

@edublancas I guess it kind of falls under the first option, but what about doing something as we did with pydts, essentially handing the missing functionality to them with another query?

@neelasha23 looks good, I'd probably also add 6. documenting those in case it's not documented already.

@neelasha23 neelasha23 mentioned this issue Apr 24, 2023
4 tasks
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 a pull request may close this issue.

3 participants