Skip to content

Conversation

@BryanCutler
Copy link
Member

@BryanCutler BryanCutler commented Mar 23, 2018

What changes were proposed in this pull request?

This cleans up unused imports, mainly from pyspark.sql module. Added a note in function.py that imports UserDefinedFunction only to maintain backwards compatibility for using from pyspark.sql.function import UserDefinedFunction.

How was this patch tested?

Existing tests and built docs.

@BryanCutler
Copy link
Member Author

BryanCutler commented Mar 23, 2018

@HyukjinKwon, @holdenk @ueshin I tried to be pretty conservative and only remove imports that were obviously not being used.

from pyspark.sql.dataframe import DataFrame
from pyspark.sql.types import StringType, DataType
# Keep UserDefinedFunction import for backwards compatible import; moved in SPARK-22409
from pyspark.sql.udf import UserDefinedFunction, _create_udf
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if there is a better way to do this other than importing UserDefinedFunction here, but hopefully the note will show the intent.

Copy link
Member

Choose a reason for hiding this comment

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

yea, I think we should better keep this import and the comment looks good.

@SparkQA
Copy link

SparkQA commented Mar 23, 2018

Test build #88547 has finished for PR 20892 at commit 5214f41.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@BryanCutler
Copy link
Member Author

Jenkins retest this please

@SparkQA
Copy link

SparkQA commented Mar 23, 2018

Test build #88549 has finished for PR 20892 at commit 5214f41.

  • 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 a9350d7 Mar 26, 2018
@BryanCutler BryanCutler deleted the pyspark-cleanup-imports-SPARK-23700 branch March 26, 2018 16:42
@BryanCutler
Copy link
Member Author

Thanks @felixcheung and @HyukjinKwon !

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