We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug While converting DFSchema to Schema, field metadata is not preserved. It may cause future bugs on methods like alias.
alias
To Reproduce Create a DFSchema that has fields with metadata.
DFSchema
let mut a: DFField = DFField::new(Some("table1"), "a", DataType::Int64, false); let mut b: DFField = DFField::new(Some("table1"), "b", DataType::Int64, false); let mut a_metadata = BTreeMap::new(); a_metadata.insert("key".to_string(), "value".to_string()); a.field.set_metadata(Some(a_metadata)); let mut b_metadata = BTreeMap::new(); b_metadata.insert("key".to_string(), "value".to_string()); b.field.set_metadata(Some(b_metadata)); let df_schema = Arc::new( DFSchema::new_with_metadata( [a, b].to_vec(), HashMap::new(), ) .unwrap(), ); let schema: Schema = df_schema.as_ref().clone().into(); let a_df = df_schema.fields.get(0).unwrap().field(); let a_arrow = schema.fields.get(0).unwrap(); assert_eq!(a_df.metadata(), a_arrow.metadata())
Expected behavior Fields preserve the metadata.
Additional context It will be solved by changing From<DFSchema> for Schema method.
From<DFSchema> for Schema
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
While converting DFSchema to Schema, field metadata is not preserved. It may cause future bugs on methods like
alias
.To Reproduce
Create a
DFSchema
that has fields with metadata.Expected behavior
Fields preserve the metadata.
Additional context
It will be solved by changing
From<DFSchema> for Schema
method.The text was updated successfully, but these errors were encountered: