@@ -743,7 +743,14 @@ def _finalize_digest(final_digest, entry: tuple) -> None:
743743class ArrowDigester :
744744 """Pure-Python equivalent of the Rust ``ArrowDigester``.
745745
746- Produces identical SHA-256 hashes with a 3-byte version prefix.
746+ Produces identical SHA-256 hashes with a 3-byte version prefix
747+ (hash format version 0.0.1, independent of the package version).
748+
749+ By default, Arrow schema- and field-level metadata are excluded from
750+ the hash. Pass ``include_metadata=True`` to any entry point to include
751+ them — see the ``include_metadata`` parameter on each method.
752+ A schema with no metadata produces the same hash regardless of that
753+ flag (empty-metadata invariant).
747754 """
748755
749756 def __init__ (self , schema : pa .Schema , * , include_metadata : bool = False ) -> None :
@@ -816,7 +823,9 @@ def hash_record_batch(record_batch: pa.RecordBatch, *, include_metadata: bool =
816823 record_batch: The record batch to hash.
817824 include_metadata: When True, schema-level and per-field Arrow
818825 metadata are included in the hash. Default is False,
819- preserving hash format 0.0.1 stability.
826+ preserving hash format 0.0.1 stability. A schema with no
827+ metadata produces the same hash regardless of this flag
828+ (empty-metadata invariant).
820829 """
821830 d = ArrowDigester (record_batch .schema , include_metadata = include_metadata )
822831 d .update (record_batch )
@@ -830,7 +839,9 @@ def hash_table(table: pa.Table, *, include_metadata: bool = False) -> bytes:
830839 table: The table to hash.
831840 include_metadata: When True, schema-level and per-field Arrow
832841 metadata are included in the hash. Default is False,
833- preserving hash format 0.0.1 stability.
842+ preserving hash format 0.0.1 stability. A schema with no
843+ metadata produces the same hash regardless of this flag
844+ (empty-metadata invariant).
834845 """
835846 d = ArrowDigester (table .schema , include_metadata = include_metadata )
836847 for batch in table .to_batches ():
@@ -842,6 +853,10 @@ def hash_array(array: pa.Array) -> bytes:
842853 """Hash a single array (spec Section 6).
843854
844855 Uses the same recursive BTreeMap decomposition as the record-batch path.
856+
857+ Note:
858+ ``include_metadata`` is intentionally absent here — standalone arrays
859+ carry no schema or field metadata. This matches the Rust ``starfix`` API.
845860 """
846861 import pyarrow as pa
847862
0 commit comments