Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@JeganVG
Copy link
Contributor

@JeganVG JeganVG commented Jan 2, 2026

…(for #765)

What changes were proposed in this pull request?

  1. Updated the pattern matching logic in toGraphX (for both vertices and edges) to explicitly catch null values.
  2. Replaced the generic GraphFramesUnreachableException with a meaningful IllegalArgumentException when null IDs are encountered.

Added Two TCs :

  1. toGraphX should throw IllegalArgumentException for null IDs
  2. toGraphX should throw IllegalArgumentException for null Edge Src/Dst

Why are the changes needed?

Fixes #765
Currently, if a GraphFrame contains null values in the ID (or src/dst) columns and toGraphX is called, the pattern matching falls, throwing a GraphFramesUnreachableException without proper exception.

@SemyonSinchenko
Copy link
Collaborator

Hi @JeganVG

Thanks for this PR! To fix the linter it should be enough to run pre-commit --all-files

@SemyonSinchenko
Copy link
Collaborator

We have both scalafmt and scalafix. If you do not want to use pre-commit, just call sbt scalafixAll

@JeganVG
Copy link
Contributor Author

JeganVG commented Jan 3, 2026

Hi @SemyonSinchenko,

My bad, I ran the comment and I didn't noticed the error after formatting was done, scalafix and scalafmt passed, I have rebuilt the PR, could you check ?

@JeganVG
Copy link
Contributor Author

JeganVG commented Jan 3, 2026

@SemyonSinchenko ,

updated the logic, verified test cases and precommit checks locally, could you check ? ;(

}

// 2. Null Src/Dst
val badEdges = edges.filter(col(SRC).isNull || col(DST).isNull).limit(1).count()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, I do not like it. It is an expensive operation. I would prefer just to raise an exception instead. If no match: an exception that graph is malformed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, I have rebuilt the PR, could you check ?

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.08%. Comparing base (e24f15e) to head (8b0549d).
⚠️ Report is 6 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #766      +/-   ##
==========================================
- Coverage   84.49%   84.08%   -0.41%     
==========================================
  Files          66       66              
  Lines        3179     3312     +133     
  Branches      387      394       +7     
==========================================
+ Hits         2686     2785      +99     
- Misses        493      527      +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@SemyonSinchenko SemyonSinchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JeganVG Thanks for the contribution!

@SemyonSinchenko SemyonSinchenko merged commit 77c5599 into graphframes:main Jan 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: it is possible to reach GraphFramesUnreachableException

3 participants