You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
When parsing fails, JsonWriter converts DeltaWriterError::DeltaTable(DeltaTableError::Arrow { source: ArrowError::JsonError(_) }) to a DeltaTableError::Generic(string). This makes it impossible to handle error cases in client code without parsing strings.
What you expected to happen:
JsonWriter should return DeltaTableError::Arrow{ source: ArrowError::JsonError(_) }.
How to reproduce it:
Add the following unit test in json.rs:
#[tokio::test]
async fn test_parsing_error() {
let table_dir = tempfile::tempdir().unwrap();
let schema = get_delta_schema();
let path = table_dir.path().to_str().unwrap().to_string();
let arrow_schema = <ArrowSchema as TryFrom<&StructType>>::try_from(&schema).unwrap();
let mut writer = JsonWriter::try_new(
path.clone(),
Arc::new(arrow_schema),
Some(vec!["modified".to_string()]),
None,
)
.unwrap();
let data = serde_json::json!(
{
"id" : "A",
"value": "abc",
"modified": "2021-02-01"
}
);
let res = writer.write(vec![data]).await;
// This assertion fails because the result is actually an `Err(DeltaTableError::Generic(string))`
assert!(matches!(
res,
Err(DeltaTableError::Arrow {
source: ArrowError::JsonError(_)
})
));
}
More details:
The text was updated successfully, but these errors were encountered:
Environment
Delta-rs version:
0.16.5 and
main
branchBinding:
Rust
Environment:
Bug
What happened:
When parsing fails, JsonWriter converts
DeltaWriterError::DeltaTable(DeltaTableError::Arrow { source: ArrowError::JsonError(_) })
to aDeltaTableError::Generic(string)
. This makes it impossible to handle error cases in client code without parsing strings.What you expected to happen:
JsonWriter should return
DeltaTableError::Arrow{ source: ArrowError::JsonError(_) }
.How to reproduce it:
Add the following unit test in
json.rs
:More details:
The text was updated successfully, but these errors were encountered: