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: handle empty string scaled_score values #36

Closed
wants to merge 1 commit into from

Conversation

bmtcril
Copy link
Contributor

@bmtcril bmtcril commented Dec 14, 2023

This is showing up on the beta server, so it can happen.

This is showing up on the beta server, so it can happen.
@bmtcril bmtcril requested a review from Ian2012 December 14, 2023 19:36
@bmtcril
Copy link
Contributor Author

bmtcril commented Dec 14, 2023

@SoryRawyer can you take a look at this one? Beta server is throwing some:

Code: 72. DB::ParsingException: Cannot read floating point value: Cannot parse Float32 from String: while executing 'FUNCTION CAST(--grades.scaled_score :: 0, 'Float' :: 4) -> CAST(--grades.scaled_score, 'Float') Float32 : 3'. (CANNOT_PARSE

This change seems to fix it.

Copy link
Contributor

@SoryRawyer SoryRawyer left a comment

Choose a reason for hiding this comment

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

Gah, sorry for not catching this. This looks good. Alternatively, you could replace the JSON_VALUE call in the grading_events model to JSONExtractFloat(event_str, 'result', 'score', 'scaled'), which would default to 0 if the key doesn't exist or if the associated value is not a float.

@bmtcril
Copy link
Contributor Author

bmtcril commented Dec 15, 2023

@SoryRawyer that's a way better solution, actually. Can you put that in #34 and we'll get it over the line there?

@bmtcril bmtcril closed this Dec 15, 2023
@bmtcril bmtcril deleted the fix_empty_scaled_score branch March 6, 2024 17:28
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.

3 participants