Skip to content

Conversation

@viirya
Copy link
Member

@viirya viirya commented May 1, 2018

What changes were proposed in this pull request?

We need to determine Spark major and minor versions in PySpark. We can add a majorMinorVersion API to PySpark which is similar to the Scala API in VersionUtils.majorMinorVersion.

How was this patch tested?

Added tests.

@viirya
Copy link
Member Author

viirya commented May 1, 2018

cc @jkbradley @HyukjinKwon @dbtsai

@viirya
Copy link
Member Author

viirya commented May 1, 2018

This is moved from #21153 based on @jkbradley's suggestion.

@viirya
Copy link
Member Author

viirya commented May 1, 2018

retest this please.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a 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
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yap, thanks.

Copy link
Member

@felixcheung felixcheung left a 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

@viirya
Copy link
Member Author

viirya commented May 1, 2018

perhaps better to match python's version_info ?

This for now is more close to VersionUtils.majorMinorVersion. To match python's version_info, means we need to have 5 components? Or just can be accessed by name?

@dongjoon-hyun
Copy link
Member

Retest this please

@SparkQA
Copy link

SparkQA commented May 1, 2018

Test build #89982 has finished for PR 21203 at commit 9558ad7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

lgtm

@HyukjinKwon
Copy link
Member

Merged to master.

@asfgit asfgit closed this in e15850b May 2, 2018
@viirya
Copy link
Member Author

viirya commented May 2, 2018

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.

@HyukjinKwon
Copy link
Member

I missed that comment too. Yea, I think it makes more sense to throw an exception - I usually use ValueError in this case though. Please go ahead for a followup.

return argspec


def majorMinorVersion(version):
Copy link
Member

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.

@HyukjinKwon
Copy link
Member

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
Copy link
Member

It's OK but would you mind fixing it @viirya before we use it in #21153 ? Thanks!

@viirya
Copy link
Member Author

viirya commented May 9, 2018

@jkbradley A follow-up has been submitted and merged. Please see #21211. Thanks.

@viirya viirya deleted the SPARK-24131 branch December 27, 2023 18:35
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.

6 participants