Skip to content
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

[SPARK-41721][CONNECT][TESTS] Enable doctests in pyspark.sql.connect.catalog #39224

Closed
wants to merge 3 commits into from

Conversation

HyukjinKwon
Copy link
Member

What changes were proposed in this pull request?

This PR proposes to enable doctests in pyspark.sql.connect.catalog that is virtually the same as pyspark.sql.catalog.

Why are the changes needed?

To make sure on the PySpark compatibility and test coverage.

Does this PR introduce any user-facing change?

No, test-only.

How was this patch tested?

CI in this PR should test this out.

@HyukjinKwon HyukjinKwon changed the title [SPARK-41721][CONNECT][TESTS] Enable doctests in pyspark.sql.connect.catalog [WIP][SPARK-41721][CONNECT][TESTS] Enable doctests in pyspark.sql.connect.catalog Dec 27, 2022
@HyukjinKwon HyukjinKwon marked this pull request as draft December 27, 2022 00:58
@HyukjinKwon HyukjinKwon changed the title [WIP][SPARK-41721][CONNECT][TESTS] Enable doctests in pyspark.sql.connect.catalog [SPARK-41721][CONNECT][TESTS] Enable doctests in pyspark.sql.connect.catalog Dec 27, 2022
@HyukjinKwon HyukjinKwon marked this pull request as ready for review December 27, 2022 04:38
@@ -273,15 +273,15 @@ def databaseExists(self, dbName: str) -> bool:

>>> spark.catalog.databaseExists("test_new_database")
False
>>> _ = spark.sql("CREATE DATABASE test_new_database")
>>> _ = spark.sql("CREATE DATABASE test_new_database").collect()
Copy link
Member Author

@HyukjinKwon HyukjinKwon Dec 27, 2022

Choose a reason for hiding this comment

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

Hmmm ... this is orthogonal issue but just to make sure we don't forget. I think we should make sql method in Spark Connect to be analyzed per every call when they execute such commands. Otherwise, we can't make it compatible with the existing PySpark usage.

I change the existing doctest here for now to make the tests pass but should change this back ideally.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

what about create a jira ticket for this (should change this back ideally)?

Copy link
Member Author

Choose a reason for hiding this comment

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

👌

@HyukjinKwon
Copy link
Member Author

Merged to master.

@HyukjinKwon HyukjinKwon deleted the SPARK-41721 branch January 15, 2024 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants