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

Add Suggestions for User Input Errors #947

Merged
merged 5 commits into from
Dec 21, 2023
Merged

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Dec 19, 2023

Description

This PR adds suggestions to error messages for metrics / group-by-items specified by the user.

@cla-bot cla-bot bot added the cla:yes label Dec 19, 2023
@plypaul plypaul marked this pull request as ready for review December 19, 2023 19:38
Copy link
Contributor

@courtneyholcomb courtneyholcomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple nits but otherwise looks good!

)
lines.append(f"\nError #{issue_counter}:")
issue_set_lines: List[str] = [
"Query Input:\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might make sense to put the query input after the error message - I'm guessing users will be looking for the error message before they look back at the query input to debug!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - should the query input go outside the loop? Currently looks like the same UI description will be printed over and over again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swapped the order. With the query input being on the outside, the nesting seemed a little deep,, and given it's unlikely an input would have multiple issues, the reduction in nesting seemed worthwhile.

)
# Resolve all where filters in the DAG.
filter_spec_lookup = self._build_filter_spec_lookup(resolution_dag)
for filer_spec_resolution in filter_spec_lookup.spec_resolutions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: filer_spec_resolution -> filter_spec_resolution

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

)


@dataclass(frozen=True)
class VirtualResolverInputForWhereFilterIntersection(MetricFlowQueryResolverInput):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "Virtual"? Confused what that's supposed to mean in this context 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM, thought about it more and removed that prefix.

Copy link
Contributor

@tlento tlento left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm only like halfway through. Hopefully @courtneyholcomb can pick this up and finish the review, but if she doesn't have time I can get to it later this afternoon.

Comment on lines 7 to 11
"""From a previous commit:

Importing fuzzywuzzy causes warning due to non-installed levenshstein package. Suppress this by catching
the warning during the import in query_parser because this package is not required.
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use fuzzywuzzy anymore, I suspect this and the captureWarnings stuff is no longer needed. We can follow up later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Comment on lines 11 to 12
class WhitelistSpecPatten(SpecPattern):
"""A spec pattern that matches based on a configured whitelist of specs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new nomenclature for this is AllowList although I prefer to call this one MatchListSpecPattern or similar, it's a bit more descriptive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@tlento
Copy link
Contributor

tlento commented Dec 19, 2023

Thanks for the lack of state notifications there, GitHub.....

@plypaul plypaul force-pushed the plypaul--70--agbir-follow-up branch from 06f2b0f to 54a9d04 Compare December 21, 2023 06:23
Base automatically changed from plypaul--70--agbir-follow-up to main December 21, 2023 06:36
@plypaul plypaul force-pushed the plypaul--71--suggestions branch from 28c8111 to d24d18e Compare December 21, 2023 06:36
@plypaul plypaul force-pushed the plypaul--71--suggestions branch from d24d18e to 043c5ac Compare December 21, 2023 06:43
@plypaul plypaul merged commit d1dd7f5 into main Dec 21, 2023
9 checks passed
@plypaul plypaul deleted the plypaul--71--suggestions branch December 21, 2023 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants