fix: resolve AttributeError in pageRank on Spark Connect (issue #889) - #890
Merged
SemyonSinchenko merged 1 commit intoAug 26, 2026
Merged
SemyonSinchenko merged 1 commit into
SemyonSinchenko merged 1 commit into
Conversation
…frames#889) GraphFrameConnect._update_page_rank_edge_weights referenced self.edges (no public attribute — only self._edges exists) and self.outDegrees (not defined on GraphFrameConnect), causing AttributeError when calling pageRank() via Spark Connect. - Add outDegrees property to GraphFrameConnect - Fix self.edges.columns → self._edges.columns Add regression test test_graphframes_pagerank covering the pageRank API.
6 tasks
Collaborator
|
Thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should address issue #889. Here is the commit details:
GraphFrameConnect._update_page_rank_edge_weights referenced self.edges (no public attribute — only self._edges exists) and self.outDegrees (not defined on GraphFrameConnect), causing AttributeError when calling pageRank() via Spark Connect.
Add regression test test_graphframes_pagerank covering the pageRank API.
What changes were proposed in this pull request?
Two fixes to
GraphFrameConnectinpython/graphframes/connect/graphframes_client.py:Added
outDegreesproperty —GraphFrameConnectwas missing this property(present on
GraphFrame) which is required by thepageRankalgorithm internally.Fixed attribute reference in
_update_page_rank_edge_weights— changedself.edges.columns→self._edges.columns.GraphFrameConnectexposes nopublic
edgesattribute; the backing DataFrame isself._edges.A regression test
test_graphframes_pagerankis added topython/tests/test_graphframes.pyto cover the
pageRank()API via Spark Connect end-to-end.Why are the changes needed?
Calling
pageRank()on aGraphFrameConnectinstance raisedAttributeErrorin twoplaces due to incorrect attribute references introduced when porting the algorithm to the
Connect client:
self.edges→AttributeError: 'GraphFrameConnect' object has no attribute 'edges'self.outDegrees→AttributeError: 'GraphFrameConnect' object has no attribute 'outDegrees'Both errors are surfaced immediately on any
pageRank()call via Spark Connect, makingthe feature completely unusable in Connect mode. This PR fixes both issues and adds a
test to prevent regression. Fixes #889.