You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2023/03/20 00:25:40 UTC

[spark] branch branch-3.4 updated: [SPARK-42848][CONNECT][PYTHON] Implement DataFrame.registerTempTable

This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch branch-3.4
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.4 by this push:
     new 613be4bdf18 [SPARK-42848][CONNECT][PYTHON] Implement DataFrame.registerTempTable
613be4bdf18 is described below

commit 613be4bdf18547c57ba1663cab60d03a886c3fb6
Author: Takuya UESHIN <ue...@databricks.com>
AuthorDate: Mon Mar 20 09:25:17 2023 +0900

    [SPARK-42848][CONNECT][PYTHON] Implement DataFrame.registerTempTable
    
    ### What changes were proposed in this pull request?
    
    Implements `DataFrame.registerTempTable`.
    
    ### Why are the changes needed?
    
    Missing API.
    
    ### Does this PR introduce _any_ user-facing change?
    
    `DataFrame.registerTempTable` will be available.
    
    ### How was this patch tested?
    
    Enabled a related test.
    
    Closes #40469 from ueshin/issues/SPARK-42848/registerTempTable.
    
    Authored-by: Takuya UESHIN <ue...@databricks.com>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
    (cherry picked from commit 71ea3909157684915fd6944e2707017d0ea32b5a)
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 python/pyspark/sql/connect/dataframe.py | 7 +++++--
 python/pyspark/sql/dataframe.py         | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/python/pyspark/sql/connect/dataframe.py b/python/pyspark/sql/connect/dataframe.py
index 03df5781197..f9ef561373d 100644
--- a/python/pyspark/sql/connect/dataframe.py
+++ b/python/pyspark/sql/connect/dataframe.py
@@ -1571,8 +1571,11 @@ class DataFrame:
     def pandas_api(self, *args: Any, **kwargs: Any) -> None:
         raise NotImplementedError("pandas_api() is not implemented.")
 
-    def registerTempTable(self, *args: Any, **kwargs: Any) -> None:
-        raise NotImplementedError("registerTempTable() is not implemented.")
+    def registerTempTable(self, name: str) -> None:
+        warnings.warn("Deprecated in 2.0, use createOrReplaceTempView instead.", FutureWarning)
+        self.createOrReplaceTempView(name)
+
+    registerTempTable.__doc__ = PySparkDataFrame.registerTempTable.__doc__
 
     def storageLevel(self, *args: Any, **kwargs: Any) -> None:
         raise NotImplementedError("storageLevel() is not implemented.")
diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py
index fde08e75747..d520aa16999 100644
--- a/python/pyspark/sql/dataframe.py
+++ b/python/pyspark/sql/dataframe.py
@@ -304,6 +304,9 @@ class DataFrame(PandasMapOpsMixin, PandasConversionMixin):
 
         .. versionadded:: 1.3.0
 
+        .. versionchanged:: 3.4.0
+            Supports Spark Connect.
+
         .. deprecated:: 2.0.0
             Use :meth:`DataFrame.createOrReplaceTempView` instead.
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org