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

fix: clearer error handling around nested arrays #3122

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

tychoish
Copy link
Collaborator

@tychoish tychoish commented Jul 30, 2024

Closes #3120

@talagluck
Copy link
Contributor

The current error returned is:

Error: Error during planning: Unable to fetch table provider for 'posts': Unsupported json type: cannot unwind nested arrays: must return objects from jaq expressions

Could we remove one of the "Error"s?

Also, I wonder if it's worth adding an example in the error message here (like "must return objects from jaq expressions, e.g. '.elements[]' instead of '.elements'"). This feels very clumsy, but this set of operations is something that I'm not very familiar with, and I imagine most people working with GlareDB here will have more experience with tabular data and trying to join in a json object instead of the other way around. It would be good to help people get unstuck, and when I search for the current error message, I don't get anything immediately helpful.

@tychoish
Copy link
Collaborator Author

Error during planning is a datafusion error, so I can't get rid of that error, and the outer error, I think is happening at the top level in the python bindings, so practically speaking there's not a good way to get out of that one.

@tychoish
Copy link
Collaborator Author

I think we could add a redirection to the docs or a perm-link to the docs, but I think in general, it's hard to write something that's clear and actionable in an error message in a way that's more helpful to the user.

We should definitely include this in the docs, however, because I think you're right that it is confusing.

Do you have any objections to merging this one?

@tychoish tychoish merged commit 232350f into main Aug 1, 2024
26 checks passed
@tychoish tychoish deleted the tycho/clearer-json-jaq-error-handling branch August 1, 2024 16:22
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.

BUG: Issue with jaq functions when filtering results in a list of elements
2 participants