-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24131][PySpark] Add majorMinorVersion API to PySpark for determining Spark versions #21203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This is moved from #21153 based on @jkbradley's suggestion. |
|
retest this please. |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM except one minor comment.
| >>> version = "abc" | ||
| >>> majorMinorVersion(version) is None | ||
| True | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. Could you remove redundant empty line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yap, thanks.
felixcheung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps better to match python's version_info ?
https://docs.python.org/2/library/sys.html#sys.version_info
This for now is more close to |
|
Retest this please |
|
Test build #89982 has finished for PR 21203 at commit
|
HyukjinKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
Merged to master. |
|
ah, sorry, @jkbradley asked me to do a little change like throwing exception when can't paring input. My flight just lands now. Let me submit a small follow-up. |
|
I missed that comment too. Yea, I think it makes more sense to throw an exception - I usually use |
| return argspec | ||
|
|
||
|
|
||
| def majorMinorVersion(version): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think he asked to add VersionUtils class.
|
Sorry @jkbradley, I rushed it. It looked making sense when I merged this but I didn't closely check the Scala side. Will be careful next time. |
|
@jkbradley A follow-up has been submitted and merged. Please see #21211. Thanks. |
What changes were proposed in this pull request?
We need to determine Spark major and minor versions in PySpark. We can add a
majorMinorVersionAPI to PySpark which is similar to the Scala API inVersionUtils.majorMinorVersion.How was this patch tested?
Added tests.