Skip to content

Commit

Permalink
Merge pull request #588 from graphistry/dev/fix-indegree-warning
Browse files Browse the repository at this point in the history
fix(get_indegrees): pandas 3 warning
  • Loading branch information
lmeyerov authored Sep 21, 2024
2 parents 22c28fa + 408f29e commit d5ab57b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
* Narrow `use_scaler` and `use_scaler_target` typing to `ScalerType` (`Literal[...]`) vs `str`
* Rename `featurize_or_get_nodes_dataframe_if_X_is_None` (and edges variant) as non-private due to being shared

### Fixed

* get_indegrees: Fix warning https://github.com/graphistry/pygraphistry/issues/587

## [0.34.3 - 2024-08-03]

### Added
Expand Down
5 changes: 3 additions & 2 deletions graphistry/compute/ComputeMixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ def get_indegrees(self, col: str = "degree_in"):
nodes_df = g_nodes._nodes[
[c for c in g_nodes._nodes.columns if c != col]
].merge(in_degree_df, how="left", on=g._node)
nodes_df[col].fillna(0, inplace=True)
nodes_df[col] = nodes_df[col].astype("int32")
nodes_df = nodes_df.assign(**{
col: nodes_df[col].fillna(0).astype("int32")
})
return g.nodes(nodes_df, g_nodes._node)

def get_outdegrees(self, col: str = "degree_out"):
Expand Down

0 comments on commit d5ab57b

Please sign in to comment.