Skip to content

Conversation

@viirya
Copy link
Member

@viirya viirya commented Apr 25, 2018

What changes were proposed in this pull request?

See SPARK-23455 for reference. Now default params in ML are saved separately in metadata file in Scala. We must change it for Python for Spark 2.4.0 as well in order to keep them in sync.

How was this patch tested?

Added test.

@SparkQA
Copy link

SparkQA commented Apr 25, 2018

Test build #89840 has finished for PR 21153 at commit 0e9b18a.

  • This patch fails Python style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 25, 2018

Test build #89841 has finished for PR 21153 at commit f32350f.

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

@viirya
Copy link
Member Author

viirya commented Apr 25, 2018

cc @jkbradley @dbtsai

jsonParams = paramMap
else:
for p in params:
jsonParams[p.name] = params[p]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think use _paramMap.copy() will be simpler.

Copy link
Member Author

Choose a reason for hiding this comment

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

_paramMap's keys are Param not string.

# Default param values
jsonDefaultParams = {}
for p in instance._defaultParamMap:
jsonDefaultParams[p.name] = instance._defaultParamMap[p]
Copy link
Contributor

Choose a reason for hiding this comment

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

similar, use _defaultParamMap.copy()

Copy link
Member Author

Choose a reason for hiding this comment

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

ditto.

for paramName in metadata['defaultParamMap']:
param = instance.getParam(paramName)
paramValue = metadata['defaultParamMap'][paramName]
instance._setDefault(**{param.name: paramValue})
Copy link
Contributor

Choose a reason for hiding this comment

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

remove line param = instance.getParam(paramName) and change this line to
instance._setDefault(**{paramName: paramValue})

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, right. My bad.

@SparkQA
Copy link

SparkQA commented Apr 27, 2018

Test build #89924 has finished for PR 21153 at commit 526fa4a.

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

Copy link
Member

@jkbradley jkbradley left a comment

Choose a reason for hiding this comment

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

I added a quick comment about moving version utils to a separate PR. I'll try to review the other parts soon. Thanks!

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.

Since this affects Spark core, it might be nice to put this in a separate PR. Also, shall we make this match the Scala API?

Copy link
Member Author

@viirya viirya May 1, 2018

Choose a reason for hiding this comment

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

Also, shall we make this match the Scala API?

Do you mean to throw exception when unable to parse Spark version?

Copy link
Member

Choose a reason for hiding this comment

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

Yes please, a few things:

  • throw exception when unable to parse
  • make it a static method of a class pyspark.util.VersionUtils
  • add unit test

@SparkQA
Copy link

SparkQA commented May 9, 2018

Test build #90393 has finished for PR 21153 at commit 86fa433.

  • This patch fails Python style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 9, 2018

Test build #90394 has finished for PR 21153 at commit b47beab.

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

@jkbradley
Copy link
Member

Would you mind rebasing this off of the upstream master branch? I'm having trouble running the tests for this PR locally.

@viirya
Copy link
Member Author

viirya commented May 11, 2018

Done. Can you try again?

@SparkQA
Copy link

SparkQA commented May 11, 2018

Test build #90486 has finished for PR 21153 at commit ce84137.

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

@viirya
Copy link
Member Author

viirya commented May 14, 2018

Not sure why AppVeyor build failed. How to re-trigger AppVeyor build?

@SparkQA
Copy link

SparkQA commented May 14, 2018

Test build #4179 has finished for PR 21153 at commit ce84137.

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

Copy link
Member

@jkbradley jkbradley left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. This LGTM except for the small typo (Hopefully fixing it will re-run the Appveyor test)

- sparkVersion
- uid
- paramMap
- defalutParamMap (since 2.4.0)
Copy link
Member

Choose a reason for hiding this comment

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

typo: default

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks.

@SparkQA
Copy link

SparkQA commented May 15, 2018

Test build #90612 has finished for PR 21153 at commit dc59375.

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

@viirya
Copy link
Member Author

viirya commented May 15, 2018

OK. Looks like AppVeyor build is ok now.

@jkbradley
Copy link
Member

OK thanks @viirya !
Merging with master

@viirya
Copy link
Member Author

viirya commented May 15, 2018

Thanks @jkbradley @WeichenXu123

@asfgit asfgit closed this in 8a13c50 May 15, 2018
@viirya viirya deleted the SPARK-24058 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.

4 participants