-
Notifications
You must be signed in to change notification settings - Fork 92
[Refactor Followup] Fix data package type and quality errors #430
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
Conversation
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
7564645 to
ad41a66
Compare
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not test but looks good
| break # Found one that works. Continuing could overwrite it. | ||
|
|
||
| if dataset is None and len(errors) > 0: | ||
| raise DataNotSupportedError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message can get a bit unruly here, can we distinguish between not supported errors and dataset errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| ) + num_chars | ||
| if (num_words := stats.get("num_words")) is not None: | ||
| input_metrics.text_words = (input_metrics.text_words or 0) + num_words | ||
| input_metrics.text_characters = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to keep the counting logic unified in the text_stats function. We could update it so that it pushes to a UsageMetrics instance directly / make that a functoin of the UsageMetrics class, but this code is duplicated and if we add anymore stats, it will make it hard to keep updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I think the new code is a much more elegant solution.
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Signed-off-by: Jared O'Connell <joconnel@redhat.com>
Summary
This PR fixes type and quality errors in the data package.
This brings the total type error count down to 124.
Some assumptions had to be made, so it would be a good idea to look for accidental changes in logic during your reviews.
Testing
Run benchmarks with various data input types to ensure they all work.
Use of AI
## WRITTEN BY AI ##)