Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
compatibility with Python API
  • Loading branch information
SemyonSinchenko committed Sep 22, 2025
commit 4e0e0035a6991da2310bf7400a988cf75fb557a5
24 changes: 24 additions & 0 deletions core/src/main/scala/org/graphframes/lib/AggregateMessages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ class AggregateMessages private[graphframes] (private val g: GraphFrame)
this
}

// Python API compatibility
def sendToSrc(value: Column): this.type = {
msgToSrc :+= value
this
}
def sendToSrc(value: String): this.type = {
msgToSrc :+= expr(value)
this
}

/** Send message to source vertex, specifying SQL expression as a String */
def sendToSrc(value: String, values: String*): this.type =
sendToSrc(expr(value), values.map(expr): _*)
Expand All @@ -89,6 +99,16 @@ class AggregateMessages private[graphframes] (private val g: GraphFrame)
this
}

// Python API compatibility
def sendToDst(value: String): this.type = {
msgToDst :+= expr(value)
this
}
def sendToDst(value: Column): this.type = {
msgToDst :+= value
this
}

/** Send message to destination vertex, specifying SQL expression as a String */
def sendToDst(value: String, values: String*): this.type =
sendToDst(expr(value), values.map(expr): _*)
Expand Down Expand Up @@ -156,6 +176,10 @@ class AggregateMessages private[graphframes] (private val g: GraphFrame)
cachedResult
}

// Python compatibility
def agg(aggCol: Column): DataFrame = agg(aggCol, Seq.empty[Column]: _*)
def agg(aggCol: String): DataFrame = agg(expr(aggCol), Seq.empty[Column]: _*)

/**
* Run the aggregation, specifying SQL expression as a String
*
Expand Down