Rich-T-kid commented on code in PR #10902:
URL: https://github.com/apache/arrow-rs/pull/10902#discussion_r3882466369
##########
arrow-schema/src/lib.rs:
##########
@@ -183,6 +183,28 @@ impl ops::Not for SortOptions {
}
}
}
+/// Controls which properties of nested [`Field`]s are considered when
comparing
+/// two [`DataType`]s for [semantic equality](DataType::semantic_equality).
+///
+/// Plain [`PartialEq`] on [`DataType`] requires an exact match of every nested
+/// field, including its name, nullability, and metadata. `EquivalenceGauge`
lets
+/// callers relax those checks, e.g. to treat `List<item: Int32>` and
+/// `List<element: Int32>` as equivalent by setting `check_field_name` to
`false`.
+#[derive(Clone, Debug)]
+pub struct EquivalenceGauge {
Review Comment:
I couldn't think of a better name so very open to suggestions
##########
arrow-schema/src/lib.rs:
##########
@@ -183,6 +183,28 @@ impl ops::Not for SortOptions {
}
}
}
+/// Controls which properties of nested [`Field`]s are considered when
comparing
+/// two [`DataType`]s for [semantic equality](DataType::semantic_equality).
+///
+/// Plain [`PartialEq`] on [`DataType`] requires an exact match of every nested
+/// field, including its name, nullability, and metadata. `EquivalenceGauge`
lets
+/// callers relax those checks, e.g. to treat `List<item: Int32>` and
+/// `List<element: Int32>` as equivalent by setting `check_field_name` to
`false`.
+#[derive(Clone, Debug)]
Review Comment:
may be worth adding a couple constructor methods like
- Default **(all true)**
- new_true **(all true)**
- new_false **(all false)**
but it may also be useful for callers to be explicit each time they call
`equal_datatypes` or `semantic_equality` 🤔
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]