Skip to content

bug: Spark Connect Page Rank Errors #889

Description

@MCBoarder289

Describe the bug

When computing page rank via Spark Connect, we get an AttributeError: 'GraphFrameConnect' object has no attribute 'edges'.

To Reproduce

Steps to reproduce the behavior:

  1. Spin up a Spark Connect Server
  2. Run a basic pagerank off of a GraphFrame:
from graphframes import GraphFrame
from pyspark.sql import Row

vertices = spark.createDataFrame([
    Row(id="a", name="Alice"),
    Row(id="b", name="Bob"),
    Row(id="c", name-"Charlie"),
])

edges = spark.createDataFrame([
    Row(src="a", dst="b", relationship="friend"),
    Row(src="b", dst="c", relationship="friend"),
    Row(src="c", dst="a", relationship="friend"),
])

g = GraphFrame(vertices, edges)
pagerank = g.pageRank(resetProbability=0.15, maxIter=5)
top_node = pagerank.vertices.orderby("pagerank", ascending=False).first()
  1. Get AttributeError

Expected behavior

pageRank function simply works and returns the results.

System [please complete the following information]:

  • OS: MacOS Tahoe 26.5.2
  • Python Version (if applied): 3.14
  • Spark / PySpark version: PySpark 3.5.8
  • GraphFrames version: graphframes-py 0.12.1

Component

  • Scala Core Internal
  • Scala API
  • Spark Connect Plugin
  • PySpark Classic
  • PySpark Connect

Additional context

Looking at the source, it looks like we should be using self._edges versus self.edges in the GraphFrameConnect class.

Are you planning on creating a PR?

  • I'm willing to make a pull-request

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions