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
Next Next commit
old type hints
  • Loading branch information
bjornjorgensen committed Jan 16, 2025
commit 79be367ae0298a8a89856408f35891fc18235673
14 changes: 7 additions & 7 deletions python/graphframes/graphframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

import sys
from typing import Any, Union
from typing import Any, Union, Optional

if sys.version > '3':
basestring = str
Expand Down Expand Up @@ -250,7 +250,7 @@ def dropIsolatedVertices(self) -> 'GraphFrame':
return _from_java_gf(jdf, self._spark)

def bfs(self, fromExpr: str, toExpr: str,
edgeFilter: str | None = None,
edgeFilter: Optional[str] = None,
maxPathLength: int = 10) -> DataFrame:
"""
Breadth-first search (BFS).
Expand Down Expand Up @@ -350,9 +350,9 @@ def labelPropagation(self, maxIter: int) -> DataFrame:
return DataFrame(jdf, self._spark)

def pageRank(self, resetProbability: float = 0.15,
sourceId: Any | None = None,
maxIter: int | None = None,
tol: float | None = None) -> 'GraphFrame':
sourceId: Optional[Any] = None,
maxIter: Optional[int] = None,
tol: Optional[float] = None) -> 'GraphFrame':
"""
Runs the PageRank algorithm on the graph.
Note: Exactly one of fixed_num_iter or tolerance must be set.
Expand Down Expand Up @@ -380,8 +380,8 @@ def pageRank(self, resetProbability: float = 0.15,
return _from_java_gf(jgf, self._spark)

def parallelPersonalizedPageRank(self, resetProbability: float = 0.15,
sourceIds: list[Any] | None = None,
maxIter: int | None = None) -> 'GraphFrame':
sourceIds: Optional[list[Any]] = None,
maxIter: Optional[int] = None) -> 'GraphFrame':
"""
Run the personalized PageRank algorithm on the graph,
from the provided list of sources in parallel for a fixed number of iterations.
Expand Down