Skip to content

Commit ed02131

Browse files
authored
arrow-schema: Remove dict_id from being required equal for merging (#7968)
# Which issue does this PR close? Closes #6356 # Rationale for this change Now that #7940 is merged, nothing useful can be done with the `dict_id` field, therefore, it is now safe to be removed from this requirement. This was also split out from: #7467 # What changes are included in this PR? No longer require the `dict_id` fields of two `Field`s of schemas being merged to be equal, as at this point the `dict_id` is only an IPC concern, and the fact that it is still in the struct definition is just legacy, marked for removal, we're just going through the proper procedure of deprecating and replacing the APIs that use it. # Are these changes tested? Tests passing. # Are there any user-facing changes? No API changes, just a behavior change, that was to be expected and desired due to the deprecations around the `dict_id` field. @alamb @adriangb @tustvold
1 parent b726b6f commit ed02131

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

arrow-schema/src/field.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -695,13 +695,6 @@ impl Field {
695695
/// assert!(field.is_nullable());
696696
/// ```
697697
pub fn try_merge(&mut self, from: &Field) -> Result<(), ArrowError> {
698-
#[allow(deprecated)]
699-
if from.dict_id != self.dict_id {
700-
return Err(ArrowError::SchemaError(format!(
701-
"Fail to merge schema field '{}' because from dict_id = {} does not match {}",
702-
self.name, from.dict_id, self.dict_id
703-
)));
704-
}
705698
if from.dict_is_ordered != self.dict_is_ordered {
706699
return Err(ArrowError::SchemaError(format!(
707700
"Fail to merge schema field '{}' because from dict_is_ordered = {} does not match {}",
@@ -840,11 +833,8 @@ impl Field {
840833
/// * self.metadata is a superset of other.metadata
841834
/// * all other fields are equal
842835
pub fn contains(&self, other: &Field) -> bool {
843-
#[allow(deprecated)]
844-
let matching_dict_id = self.dict_id == other.dict_id;
845836
self.name == other.name
846837
&& self.data_type.contains(&other.data_type)
847-
&& matching_dict_id
848838
&& self.dict_is_ordered == other.dict_is_ordered
849839
// self need to be nullable or both of them are not nullable
850840
&& (self.nullable || !other.nullable)

0 commit comments

Comments
 (0)