HyukjinKwon commented on code in PR #40722:
URL: https://github.com/apache/spark/pull/40722#discussion_r1161535121
##########
python/pyspark/pandas/frame.py:
##########
@@ -10650,7 +10677,15 @@ def stack(self) -> DataFrameOrSeries:
).with_filter(F.lit(False))
)
- column_labels: Dict[Label, Dict[Any, GenericColumn]] =
defaultdict(dict)
+ if is_remote():
+ from pyspark.sql.connect.column import Column as ConnectColumn
+
+ Column = ConnectColumn
+ else:
+ Column = PySparkColumn # type: ignore[assignment]
+ column_labels: Dict[Label, Dict[Any, Column]] = defaultdict( # type:
ignore[valid-type]
Review Comment:
just use PySparkColumn
##########
python/pyspark/pandas/frame.py:
##########
@@ -10956,7 +10991,13 @@ def all(
if len(column_labels) == 0:
return ps.Series([], dtype=bool)
- applied: List[GenericColumn] = []
+ if is_remote():
+ from pyspark.sql.connect.column import Column as ConnectColumn
+
+ Column = ConnectColumn
+ else:
+ Column = PySparkColumn # type: ignore[assignment]
+ applied: List[Column] = [] # type: ignore[valid-type]
Review Comment:
just use PySparkColumn
##########
python/pyspark/pandas/frame.py:
##########
@@ -11039,7 +11080,13 @@ def any(self, axis: Axis = 0, bool_only:
Optional[bool] = None) -> "Series":
if len(column_labels) == 0:
return ps.Series([], dtype=bool)
- applied: List[GenericColumn] = []
+ if is_remote():
+ from pyspark.sql.connect.column import Column as ConnectColumn
+
+ Column = ConnectColumn
+ else:
+ Column = PySparkColumn # type: ignore[assignment]
+ applied: List[Column] = [] # type: ignore[valid-type]
Review Comment:
just use PySparkColumn
##########
python/pyspark/pandas/frame.py:
##########
@@ -11890,7 +11937,14 @@ def pct_change(self, periods: int = 1) -> "DataFrame":
"""
window =
Window.orderBy(NATURAL_ORDER_COLUMN_NAME).rowsBetween(-periods, -periods)
- def op(psser: ps.Series) -> GenericColumn:
+ if is_remote():
+ from pyspark.sql.connect.column import Column as ConnectColumn
+
+ Column = ConnectColumn
+ else:
+ Column = PySparkColumn # type: ignore[assignment]
+
+ def op(psser: ps.Series) -> Column: # type: ignore[valid-type]
Review Comment:
just use PySparkColumn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]