Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-36896][PYTHON] Return boolean for
dropTempView
and `dropGlob…
…alTempView` ### What changes were proposed in this pull request? Currently `dropTempView` and `dropGlobalTempView` don't have return value, which conflicts with their docstring: `Returns true if this view is dropped successfully, false otherwise.`. And that's not consistent with the same API in other languages. The PR proposes a fix for that. ### Why are the changes needed? Be consistent with API in other languages. ### Does this PR introduce _any_ user-facing change? Yes. #### From ```py # dropTempView >>> spark.createDataFrame([(1, 1)]).createTempView("my_table") >>> spark.table("my_table").collect() [Row(_1=1, _2=1)] >>> spark.catalog.dropTempView("my_table") >>> spark.catalog.dropTempView("my_table") # dropGlobalTempView >>> spark.createDataFrame([(1, 1)]).createGlobalTempView("my_table") >>> spark.table("global_temp.my_table").collect() [Row(_1=1, _2=1)] >>> spark.catalog.dropGlobalTempView("my_table") >>> spark.catalog.dropGlobalTempView("my_table") ``` #### To ```py # dropTempView >>> spark.createDataFrame([(1, 1)]).createTempView("my_table") >>> spark.table("my_table").collect() [Row(_1=1, _2=1)] >>> spark.catalog.dropTempView("my_table") True >>> spark.catalog.dropTempView("my_table") False # dropGlobalTempView >>> spark.createDataFrame([(1, 1)]).createGlobalTempView("my_table") >>> spark.table("global_temp.my_table").collect() [Row(_1=1, _2=1)] >>> spark.catalog.dropGlobalTempView("my_table") True >>> spark.catalog.dropGlobalTempView("my_table") False ``` ### How was this patch tested? Existing tests. Closes #34147 from xinrong-databricks/fix_return. Authored-by: Xinrong Meng <xinrong.meng@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
- Loading branch information