diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py index 8f4454a08d57d..84fee0816d824 100644 --- a/python/pyspark/sql/dataframe.py +++ b/python/pyspark/sql/dataframe.py @@ -2135,10 +2135,16 @@ def transform(self, func): "should have been DataFrame." % type(result) return result - ########################################################################################## - # Pandas compatibility - ########################################################################################## + where = copy_func( + filter, + sinceversion=1.3, + doc=":func:`where` is an alias for :func:`filter`.") + # Two aliases below were added for pandas compatibility many years ago. + # There are too many differences compared to pandas and we cannot just + # make it "compatible" by adding aliases. Therefore, we stop adding such + # aliases as of Spark 3.0. Two methods below remain just + # for legacy users currently. groupby = copy_func( groupBy, sinceversion=1.4, @@ -2149,11 +2155,6 @@ def transform(self, func): sinceversion=1.4, doc=":func:`drop_duplicates` is an alias for :func:`dropDuplicates`.") - where = copy_func( - filter, - sinceversion=1.3, - doc=":func:`where` is an alias for :func:`filter`.") - def _to_scala_map(sc, jm): """