This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new ed02131430 arrow-schema: Remove dict_id from being required equal for 
merging (#7968)
ed02131430 is described below

commit ed02131430a08d47f173b4552316da4058dfa7bc
Author: Frederic Branczyk <fbranc...@gmail.com>
AuthorDate: Tue Jul 22 23:41:21 2025 +0200

    arrow-schema: Remove dict_id from being required equal for merging (#7968)
    
    # Which issue does this PR close?
    
    Closes https://github.com/apache/arrow-rs/issues/6356
    
    # Rationale for this change
    
    Now that https://github.com/apache/arrow-rs/pull/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:
    https://github.com/apache/arrow-rs/pull/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
---
 arrow-schema/src/field.rs | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/arrow-schema/src/field.rs b/arrow-schema/src/field.rs
index 9aa1a40f4e..469c930d31 100644
--- a/arrow-schema/src/field.rs
+++ b/arrow-schema/src/field.rs
@@ -695,13 +695,6 @@ impl Field {
     /// assert!(field.is_nullable());
     /// ```
     pub fn try_merge(&mut self, from: &Field) -> Result<(), ArrowError> {
-        #[allow(deprecated)]
-        if from.dict_id != self.dict_id {
-            return Err(ArrowError::SchemaError(format!(
-                "Fail to merge schema field '{}' because from dict_id = {} 
does not match {}",
-                self.name, from.dict_id, self.dict_id
-            )));
-        }
         if from.dict_is_ordered != self.dict_is_ordered {
             return Err(ArrowError::SchemaError(format!(
                 "Fail to merge schema field '{}' because from dict_is_ordered 
= {} does not match {}",
@@ -840,11 +833,8 @@ impl Field {
     /// * self.metadata is a superset of other.metadata
     /// * all other fields are equal
     pub fn contains(&self, other: &Field) -> bool {
-        #[allow(deprecated)]
-        let matching_dict_id = self.dict_id == other.dict_id;
         self.name == other.name
         && self.data_type.contains(&other.data_type)
-        && matching_dict_id
         && self.dict_is_ordered == other.dict_is_ordered
         // self need to be nullable or both of them are not nullable
         && (self.nullable || !other.nullable)

Reply via email to