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

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


The following commit(s) were added to refs/heads/master by this push:
     new 213ac1c946d [SPARK-45177][PS] Remove `col_space` parameter from 
`to_latex`
213ac1c946d is described below

commit 213ac1c946d8bc426a636e2547262096198f61ac
Author: Haejoon Lee <haejoon....@databricks.com>
AuthorDate: Fri Sep 15 16:32:05 2023 +0900

    [SPARK-45177][PS] Remove `col_space` parameter from `to_latex`
    
    ### What changes were proposed in this pull request?
    
    This PR proposes to remove `col_space` parameter from `DataFrame.to_latex` 
and `Series.to_latex`
    
    ### Why are the changes needed?
    
    Since they're also removed from Pandas 2.0.0, so we should follow.
    
    ### Does this PR introduce _any_ user-facing change?
    
    `col_space` from `DataFrame.to_latex` and `Series.to_latex` has been 
removed as mentioned from migration guide.
    
    ### How was this patch tested?
    
    Removed the deprecated tests.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No
    
    Closes #42937 from itholic/SPARK-45177.
    
    Authored-by: Haejoon Lee <haejoon....@databricks.com>
    Signed-off-by: Hyukjin Kwon <gurwls...@apache.org>
---
 python/docs/source/migration_guide/pyspark_upgrade.rst   |  1 +
 python/pyspark/pandas/frame.py                           | 11 -----------
 python/pyspark/pandas/series.py                          |  6 ------
 python/pyspark/pandas/tests/test_dataframe_conversion.py |  1 -
 python/pyspark/pandas/tests/test_series_conversion.py    |  1 -
 5 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/python/docs/source/migration_guide/pyspark_upgrade.rst 
b/python/docs/source/migration_guide/pyspark_upgrade.rst
index 992101734ff..53d82554d75 100644
--- a/python/docs/source/migration_guide/pyspark_upgrade.rst
+++ b/python/docs/source/migration_guide/pyspark_upgrade.rst
@@ -42,6 +42,7 @@ Upgrading from PySpark 3.5 to 4.0
 * In Spark 4.0, ``squeeze`` parameter from ``ps.read_csv`` and 
``ps.read_excel`` has been removed from pandas API on Spark.
 * In Spark 4.0, ``null_counts`` parameter from ``DataFrame.info`` has been 
removed from pandas API on Spark, use ``show_counts`` instead.
 * In Spark 4.0, the result of ``MultiIndex.append`` does not keep the index 
names from pandas API on Spark.
+* In Spark 4.0, ``col_space`` parameter from ``DataFrame.to_latex`` and 
``Series.to_latex`` has been removed from pandas API on Spark.
 
 
 Upgrading from PySpark 3.3 to 3.4
diff --git a/python/pyspark/pandas/frame.py b/python/pyspark/pandas/frame.py
index 3aebbd65427..fedbfcdb5f3 100644
--- a/python/pyspark/pandas/frame.py
+++ b/python/pyspark/pandas/frame.py
@@ -2473,7 +2473,6 @@ defaultdict(<class 'list'>, {'col..., 'col...})]
         self,
         buf: Optional[IO[str]] = None,
         columns: Optional[List[Name]] = None,
-        col_space: Optional[int] = None,
         header: bool = True,
         index: bool = True,
         na_rep: str = "NaN",
@@ -2509,11 +2508,6 @@ defaultdict(<class 'list'>, {'col..., 'col...})]
             Buffer to write to. If None, the output is returned as a string.
         columns : list of label, optional
             The subset of columns to write. Writes all columns by default.
-        col_space : int, optional
-            The minimum width of each column.
-
-            .. deprecated:: 3.4.0
-
         header : bool or list of str, default True
             Write out the column names. If a list of strings is given, it is 
assumed to be aliases
             for the column names.
@@ -2590,11 +2584,6 @@ defaultdict(<class 'list'>, {'col..., 'col...})]
         \bottomrule
         \end{tabular}
         """
-        warnings.warn(
-            "Argument `col_space` will be removed in 4.0.0.",
-            FutureWarning,
-        )
-
         args = locals()
         psdf = self
         return validate_arguments_and_invoke_function(
diff --git a/python/pyspark/pandas/series.py b/python/pyspark/pandas/series.py
index 863e98c42ea..5ef814eea36 100644
--- a/python/pyspark/pandas/series.py
+++ b/python/pyspark/pandas/series.py
@@ -1662,7 +1662,6 @@ class Series(Frame, IndexOpsMixin, Generic[T]):
         self,
         buf: Optional[IO[str]] = None,
         columns: Optional[List[Name]] = None,
-        col_space: Optional[int] = None,
         header: bool = True,
         index: bool = True,
         na_rep: str = "NaN",
@@ -1682,11 +1681,6 @@ class Series(Frame, IndexOpsMixin, Generic[T]):
         multicolumn_format: Optional[str] = None,
         multirow: Optional[bool] = None,
     ) -> Optional[str]:
-        warnings.warn(
-            "Argument `col_space` will be removed in 4.0.0.",
-            FutureWarning,
-        )
-
         args = locals()
         psseries = self
         return validate_arguments_and_invoke_function(
diff --git a/python/pyspark/pandas/tests/test_dataframe_conversion.py 
b/python/pyspark/pandas/tests/test_dataframe_conversion.py
index d245b449d57..655c0970082 100644
--- a/python/pyspark/pandas/tests/test_dataframe_conversion.py
+++ b/python/pyspark/pandas/tests/test_dataframe_conversion.py
@@ -211,7 +211,6 @@ class DataFrameConversionTestsMixin:
         psdf = self.psdf
 
         self.assert_eq(psdf.to_latex(), pdf.to_latex())
-        self.assert_eq(psdf.to_latex(col_space=2), pdf.to_latex(col_space=2))
         self.assert_eq(psdf.to_latex(header=True), pdf.to_latex(header=True))
         self.assert_eq(psdf.to_latex(index=False), pdf.to_latex(index=False))
         self.assert_eq(psdf.to_latex(na_rep="-"), pdf.to_latex(na_rep="-"))
diff --git a/python/pyspark/pandas/tests/test_series_conversion.py 
b/python/pyspark/pandas/tests/test_series_conversion.py
index cbdb02db85a..757da167250 100644
--- a/python/pyspark/pandas/tests/test_series_conversion.py
+++ b/python/pyspark/pandas/tests/test_series_conversion.py
@@ -58,7 +58,6 @@ class SeriesConversionTestsMixin:
         psser = self.psser
 
         self.assert_eq(psser.to_latex(), pser.to_latex())
-        self.assert_eq(psser.to_latex(col_space=2), pser.to_latex(col_space=2))
         self.assert_eq(psser.to_latex(header=True), pser.to_latex(header=True))
         self.assert_eq(psser.to_latex(index=False), pser.to_latex(index=False))
         self.assert_eq(psser.to_latex(na_rep="-"), pser.to_latex(na_rep="-"))


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

Reply via email to