Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Jul 19, 2023

What changes were proposed in this pull request?

This PR proposes to expose and document pyspark.sql.is_remote as an API.

Why are the changes needed?

For the end users to be able to do if-else, e.g., for dispatching the code path to the legacy mode or connect mode.

Does this PR introduce any user-facing change?

Yes, it exposes a method as an API.

How was this patch tested?

Manually built and checked the documentation.

Copy link
Contributor

@harupy harupy left a comment

Choose a reason for hiding this comment

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

LGTM!

"DataFrameWriter",
"DataFrameWriterV2",
"PandasCogroupedOps",
"is_remote",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we expose this as pyspark.sql.utils.is_remote?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should just expose it under pyspark.sql because APIs are usually exposed under that namespace. I think you can use it as:

is_remote = getattr(pyspark.sql, "is_remote", getattr(pyspark.sql.utils, "is_remote", None))()

@HyukjinKwon
Copy link
Member Author

Merged to master.

@HyukjinKwon HyukjinKwon deleted the SPARK-44481 branch January 15, 2024 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants