| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
⚠️ Please install the Codecov ReportAttention: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #506 +/- ##
==========================================
- Coverage 91.43% 90.35% -1.09%
==========================================
Files 18 18
Lines 829 902 +73
Branches 52 96 +44
==========================================
+ Hits 758 815 +57
- Misses 71 87 +16 ☔ View full report in Codecov by Sentry. |
Sorry, something went wrong.
|
@rjurney Hello! At the moment PR provides a (mostly) working version of GrahFrames API for PySpark Connect. There are a lot of open questions from my side:
How to try it: run the script in dev folder. Connect to the Spark Connect Server with SparkSession.builder.remote("sc://localhost:15002").getOrCreate() and use graphframes.connect.graphframes_client.GraphFrameConnect. |
Sorry, something went wrong.
My PR #473 converts the unit tests to pytest tests. That should help there. My PR is a monster, I will work on breaking it up into pieces tomorrow and that should give you the ability to pull the test-related code into your PR. It would be nice if there wasn't a completely different API for Spark Connect. How different are the implementations? I'll take a look at the PR tomorrow and see. This is very cool work, thanks for it! |
Sorry, something went wrong.
It is the same, just implemented as a separate class (python/graphframes/connect/graphframe_client.py) |
Sorry, something went wrong.
|
Is it feasible to add connect support to GraphFrame? Especially if it could detect a Connect connection and 'just work' or take an argument? |
Sorry, something went wrong.
Of course. That is the idea, but the question is how to do it? In Spark 3.x devs made a decision to make two versions of DataFrame (pyspark.sql.DataFrame and pyspark.sql.connect.dataframe.DataFrame). In the Spark 4.x it is changed and there are three versions at the moment:
I did not want to touch the existing code in this PR. I would like to finalize the implementation as a standalone GraphFrameConnect class that has exactly the same API as an existing GraphFrame. And we can deal with an integration in the next iteration. What do you think about it? |
Sorry, something went wrong.
|
To be honest, I like the idea of dispatch like in PySpark, but it will require big changes in the current GraphFrame, tests, build, etc. I think it would be better to do in GraphFrames 1.0 because I would like to slightly change the public API. For example, due to Spark Connect limitations it maybe tricky to return both loss and DataFrame from svdPlusPlus. I would like to change the signature and do not return the loss by default. The same about PageRank: I would like to make computation of the edge weights optional with default to False. |
Sorry, something went wrong.
Ohhhh wow, okay. Now this all makes sense :) I would not have thought that. Everything makes sense now. I think you're doing what makes sense. |
Sorry, something went wrong.
|
Questions / Topics
|
Sorry, something went wrong.
|
@SemyonSinchenko thanks for your work here, this is just awesome. I am going to give it a thorough review this weekend, sooner if I can. Will have questions borne of my lack of Scala knowledge as much as anything :) |
Sorry, something went wrong.
|
@rjurney What is the plan for the review? Will you review this changes, or should I try to ask someone else to review this? |
Sorry, something went wrong.
|
@SemyonSinchenko can you describe any changes to the user experience of GraphFrames? Today I am using databricks-connect via VSCode for PySpark on Databricks and I can't use GraphFrame.pageRank because I am on Connect. Will it work with this PR? What about checkpointing code? That doesn't work either. Just wondering. |
Sorry, something went wrong.
For classic users nothing should changes, only some minor / questinable things. For example, I introduced the build of JAR to the process of building the graphframes PySpark. Maybe I should remove it. Should I? For connect users it is different. They should add graphframes-connect JAR to the Spark Connect Server part and add a spark conf like spark.connect.extensions.relation.classes=org.apache.spark.sql.graphframes.GraphFramesConnect to configuration of their Spark Connect Server. That is how the connect plugin system is supposed to be used. Answers:
|
Sorry, something went wrong.
|
@rjurney JFYI. Because I know about the breaking change in connect plugins system from Apache Spark 3.5.x to 4.0.x (the change, that in my understanding is already in the DBR 14.x and 15.x), I separated all the plugins logic from the plugin itself: the plugin itself is less than five logical lines of code to simplify the migration (and DBR shim) as much as possible. In Apache Spark 4.0.x the signature is changed to Optional<LogicalPlan> transform(byte[] relation, SparkConnectPlanner planner); and my workaround with shading of GraphFrames proto message is not needed anymore. |
Sorry, something went wrong.
|
@SemyonSinchenko so is it ready for review then? |
Sorry, something went wrong.
@rjurney Yes, it is. I still need to resolve merge conflicts, but 99% of them are related to the tests, not to the logic. Also one additional method will be introduced to wrap also a recently added power iteration clustering. |
Sorry, something went wrong.
Classic tests are passed; ++some changes
|
@rjurney I resolved all the conflicts. An important changes you should check:
At the moment only part of tests are turned on for Connect because other part of tests is based on the examples that are called through py4j. |
Sorry, something went wrong.
|
Wow, awesome! I'll review it now. |
Sorry, something went wrong.
There was a problem hiding this comment.
@SemyonSinchenko I'm going ahead and approving this, although I would appreciate a brief explanation of where dispatch is implemented because I can't tell what the user experience of this new approach i.e. normal vs connect.
Sorry, something went wrong.
| _sym_db = _symbol_database.Default() | ||
|
|
||
|
|
||
| DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( |
There was a problem hiding this comment.
@SemyonSinchenko what is this?
Sorry, something went wrong.
There was a problem hiding this comment.
Wait, do not look on this. This code is generated automatically by the protoc (buf)!
Sorry, something went wrong.
| return _from_java_gf(jdf, self._spark) | ||
|
|
||
| def filterEdges(self, condition: Union[str, Column]) -> "GraphFrame": | ||
| def filterEdges(self, condition: str | Column) -> "GraphFrame": |
There was a problem hiding this comment.
What version of Python introduced this? Ahhh 3.5. Cool, I learned about it :)
Sorry, something went wrong.
There was a problem hiding this comment.
I think it is quite new, but it was backported in all supported versions, so all that you need to do is to add a line:
from __future__ import annotations
Sorry, something went wrong.
| raise TypeError("condition should be string or Column") | ||
| return _from_java_gf(jdf, self._spark) | ||
|
|
||
| return GraphFrame._from_impl(self._impl.filterEdges(condition=condition)) |
There was a problem hiding this comment.
Is this exception handling handled elsewhere?
Sorry, something went wrong.
There was a problem hiding this comment.
In the proposed design, all the exception are the responsibility of the implementation. So, answer is yes, it is handled in impl.
Sorry, something went wrong.
|
@SemyonSinchenko regarding the JAR, I think it is right to include it and think we should add it to MANIFEST.in. |
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm again
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Work is in progress but the overall design is in the final state:
For JVM part generation is built in to the build.sbt; for Python (and possible other clients) buf (buf.yaml, buf.gen.yaml)
Close #447