diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ed7d27516..368d63af4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Development] +### Fixed +- **Mypy**: Declare UMAP mixin weighted-edge DataFrame attributes for type checking. + ### Tests - **Temporal**: Added datetime unit parity coverage (ms/us/ns) for ring layouts, GFQL time ring layouts, and temporal comparison predicates; relaxed honeypot hypergraph datetime unit expectations. diff --git a/graphistry/umap_utils.py b/graphistry/umap_utils.py index 55aed90332..1289f83790 100644 --- a/graphistry/umap_utils.py +++ b/graphistry/umap_utils.py @@ -26,14 +26,18 @@ logger = setup_logger(__name__) +DataFrameLike = Union[pd.DataFrame, Any] + if TYPE_CHECKING: - MIXIN_BASE = FeatureMixin + class _UMAPMixinBase(FeatureMixin): + _weighted_edges_df: Optional[DataFrameLike] + _weighted_edges_df_from_nodes: Optional[DataFrameLike] + _weighted_edges_df_from_edges: Optional[DataFrameLike] + + MIXIN_BASE = _UMAPMixinBase else: MIXIN_BASE = object - -DataFrameLike = Union[pd.DataFrame, Any] - # Error message for empty feature matrix _EMPTY_FEATURES_ERROR_MSG = ( "UMAP requires at least one numeric feature column, but received empty feature matrix. " @@ -1134,3 +1138,4 @@ def filter_weighted_edges( if not inplace: return res +