diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index 9045ceed872..eb7eb7eb363 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -296,16 +296,16 @@ class ResolvedGrouper(Generic[T_DataWithCoords]): obj: T_DataWithCoords # returned by factorize: - codes: DataArray = field(init=False) - full_index: pd.Index = field(init=False) - group_indices: T_GroupIndices = field(init=False) - unique_coord: Variable | _DummyGroup = field(init=False) + codes: DataArray = field(init=False, repr=False) + full_index: pd.Index = field(init=False, repr=False) + group_indices: T_GroupIndices = field(init=False, repr=False) + unique_coord: Variable | _DummyGroup = field(init=False, repr=False) # _ensure_1d: - group1d: T_Group = field(init=False) - stacked_obj: T_DataWithCoords = field(init=False) - stacked_dim: Hashable | None = field(init=False) - inserted_dims: list[Hashable] = field(init=False) + group1d: T_Group = field(init=False, repr=False) + stacked_obj: T_DataWithCoords = field(init=False, repr=False) + stacked_dim: Hashable | None = field(init=False, repr=False) + inserted_dims: list[Hashable] = field(init=False, repr=False) def __post_init__(self) -> None: # This copy allows the BinGrouper.factorize() method diff --git a/xarray/core/groupers.py b/xarray/core/groupers.py index a71da16c718..e905280280e 100644 --- a/xarray/core/groupers.py +++ b/xarray/core/groupers.py @@ -117,7 +117,7 @@ class Resampler(Grouper): class UniqueGrouper(Grouper): """Grouper object for grouping by a categorical variable.""" - _group_as_index: pd.Index | None = None + _group_as_index: pd.Index | None = field(default=None, repr=False) @property def is_unique_and_monotonic(self) -> bool: @@ -336,8 +336,8 @@ class TimeResampler(Resampler): loffset: datetime.timedelta | str | None = field(default=None) base: int | None = field(default=None) - index_grouper: CFTimeGrouper | pd.Grouper = field(init=False) - group_as_index: pd.Index = field(init=False) + index_grouper: CFTimeGrouper | pd.Grouper = field(init=False, repr=False) + group_as_index: pd.Index = field(init=False, repr=False) def __post_init__(self): if self.loffset is not None: