Skip to content

Commit 9f1f1bd

Browse files
committed
fixup
1 parent 332eae4 commit 9f1f1bd

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

python/pyspark/sql/classic/dataframe.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
)
4040

4141
from pyspark import _NoValue
42+
from pyspark.resource import ResourceProfile
4243
from pyspark._globals import _NoValueType
4344
from pyspark.errors import (
4445
PySparkTypeError,
@@ -1807,6 +1808,27 @@ def pandas_api(
18071808
)
18081809
return PandasOnSparkDataFrame(internal)
18091810

1811+
def mapInPandas(
1812+
self,
1813+
func: "PandasMapIterFunction",
1814+
schema: Union[StructType, str],
1815+
barrier: bool = False,
1816+
profile: Optional[ResourceProfile] = None,
1817+
) -> "DataFrame":
1818+
return super(PandasMapOpsMixin, self).mapInPandas(func, schema, barrier, profile)
1819+
1820+
def mapInArrow(
1821+
self,
1822+
func: "ArrowMapIterFunction",
1823+
schema: Union[StructType, str],
1824+
barrier: bool = False,
1825+
profile: Optional[ResourceProfile] = None,
1826+
) -> "DataFrame":
1827+
return super(PandasMapOpsMixin, self).mapInArrow(func, schema, barrier, profile)
1828+
1829+
def toPandas(self) -> "PandasDataFrameLike":
1830+
return super(PandasConversionMixin, self).toPandas()
1831+
18101832

18111833
def _to_scala_map(sc: "SparkContext", jm: Dict) -> "JavaObject":
18121834
"""

python/pyspark/sql/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def dispatch_df_method(f: FuncT) -> FuncT:
310310

311311
@functools.wraps(f)
312312
def wrapped(*args: Any, **kwargs: Any) -> Any:
313-
if is_remote():
313+
if is_remote() and "PYSPARK_NO_NAMESPACE_SHARE" not in os.environ:
314314
from pyspark.sql.connect.dataframe import DataFrame as ConnectDataFrame
315315

316316
if isinstance(args[0], ConnectDataFrame):

0 commit comments

Comments
 (0)