impl(bigquery): add row parsing errors#5917
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the RowError and ConvertError enums to handle failures when retrieving and converting BigQuery row values, along with comprehensive unit tests for their display formatting. The feedback suggests expanding the documentation for RowError to clarify that it can also represent errors occurring during query result iteration due to its Rpc variant.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5917 +/- ##
=======================================
Coverage 97.90% 97.90%
=======================================
Files 234 234
Lines 59451 59487 +36
=======================================
+ Hits 58205 58243 +38
+ Misses 1246 1244 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| pub enum ConvertError { | ||
| /// The value type did not match the expected type. | ||
| #[error("type mismatch, expected {expected}, got {got:?}")] | ||
| TypeMismatch { |
There was a problem hiding this comment.
Q: what is the difference between TypeMismatch and Convert ?
There was a problem hiding this comment.
TypeMismatch is an error for when the value coming under the hood is not what we expect (like we expect a TIMESTAMP column to be a int64 in String format, but if we get another format, we don't even try to parse and raise TypeMismatch.
Convert is when the types are correct, but when actually trying to parse, it fails. Maybe we are parsing a INTEGER, which is expected to come as String, it comes like that, but inside the string there is a non integer value.
So TypeMismatch doesn't even try to parse as the types are incorrect and Convert is that the types match, but parsing failed.
Towards #5844