From 6b19f4699b715cce20c861b49161b5bef8443fac Mon Sep 17 00:00:00 2001 From: ihb2032 Date: Sat, 26 Sep 2026 19:37:09 +0800 Subject: [PATCH] refactor(series): the ReduceOp equality extension joins the engine seam MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The enum and reducer_for were already #doc(hidden) engine seams, but the Eq extension's promoted equal/not_equal stayed in the series interface — two methods on a type the interface never declares. The extension now carries the same attribute pair as the KeyCell extensions, so the last visible trace of the seam leaves the public interface; the engine packages keep reaching it as before. --- .github/scripts/engine_seams.snapshot | 1 + .github/scripts/facade_surface.snapshot | 2 -- series/pkg.generated.mbti | 3 --- series/reduce.mbt | 6 ++++++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/scripts/engine_seams.snapshot b/.github/scripts/engine_seams.snapshot index 9734bc80..be383561 100644 --- a/.github/scripts/engine_seams.snapshot +++ b/.github/scripts/engine_seams.snapshot @@ -14,6 +14,7 @@ io | doc_hidden internal_engine | pub fn write_text( path : String, content : St series | doc_hidden internal_engine | pub enum SortKey series | doc_hidden internal_engine | pub extend KeyCell with Eq::{equal, not_equal} series | doc_hidden internal_engine | pub extend KeyCell with Hash::{hash, hash_combine} +series | doc_hidden internal_engine | pub extend ReduceOp with Eq::{equal, not_equal} series | doc_hidden internal_engine | pub fn Series::build_sort_key( self : Series, descending : Bool, nulls_last : Bool, ) -> SortKey | used by: frame series | doc_hidden internal_engine | pub fn Series::coalesce_columns( self : Series, fill : Series, name : String, ) -> Series | used by: frame series | doc_hidden internal_engine | pub fn Series::empty_of( name : String, dtype : @types.DataType, ) -> Series raise @types.DataError | used by: frame diff --git a/.github/scripts/facade_surface.snapshot b/.github/scripts/facade_surface.snapshot index 575352a9..c91f9259 100644 --- a/.github/scripts/facade_surface.snapshot +++ b/.github/scripts/facade_surface.snapshot @@ -308,8 +308,6 @@ method OnParseError::to_repr(Self) -> @debug.Repr <- io method ParseErrorDetail::equal(Self, Self) -> Bool <- types method ParseErrorDetail::not_equal(Self, Self) -> Bool <- types method ParseErrorDetail::to_repr(Self) -> @debug.Repr <- types -method ReduceOp::equal(Self, Self) -> Bool <- series -method ReduceOp::not_equal(Self, Self) -> Bool <- series method Scalar::as_bool(Self) -> Bool raise DataError <- types method Scalar::as_float(Self) -> Double raise DataError <- types method Scalar::as_int(Self) -> Int64 raise DataError <- types diff --git a/series/pkg.generated.mbti b/series/pkg.generated.mbti index 81f629b6..475ae504 100644 --- a/series/pkg.generated.mbti +++ b/series/pkg.generated.mbti @@ -55,9 +55,6 @@ pub fn Series::to_repr(Self) -> @debug.Repr pub fn Series::to_scalars(Self) -> Array[@types.Scalar] pub fn Series::variance(Self) -> Double raise @types.DataError -pub fn ReduceOp::equal(Self, Self) -> Bool -pub fn ReduceOp::not_equal(Self, Self) -> Bool - // Type aliases // Traits diff --git a/series/reduce.mbt b/series/reduce.mbt index 1cf43235..140c3e41 100644 --- a/series/reduce.mbt +++ b/series/reduce.mbt @@ -508,6 +508,12 @@ pub(all) enum ReduceOp { } derive(Eq) ///| +/// Equality for the engine packages: the expression AST carries a `ReduceOp` +/// inside its `Agg` node, and the AST's own `Eq` derive reaches this method +/// from another package. The attributes keep the promoted methods out of the +/// public interface, like the enum they belong to. +#doc(hidden) +#internal(engine, "MoonFrame execution engine API") pub extend ReduceOp with Eq::{equal, not_equal} ///|