HyukjinKwon commented on code in PR #41877:
URL: https://github.com/apache/spark/pull/41877#discussion_r1286739868


##########
python/pyspark/pandas/resample.py:
##########
@@ -131,8 +134,27 @@ def _resamplekey_scol(self) -> Column:
     def _agg_columns_scols(self) -> List[Column]:
         return [s.spark.column for s in self._agg_columns]
 
+    def get_make_interval(  # type: ignore[return]
+        self, unit: str, col: Union[Column, int, float]
+    ) -> Column:
+        if is_remote():
+            from pyspark.sql.connect.functions import lit, make_interval
+
+            col = col if not isinstance(col, (int, float)) else lit(col)  # 
type: ignore[assignment]
+            if unit == "MONTH":
+                return make_interval(months=col)  # type: ignore
+            if unit == "HOUR":
+                return make_interval(hours=col)  # type: ignore
+            if unit == "MINUTE":
+                return make_interval(mins=col)  # type: ignore
+            if unit == "SECOND":
+                return make_interval(secs=col)  # type: ignore
+        else:
+            sql_utils = SparkContext._active_spark_context._jvm.PythonSQLUtils

Review Comment:
   @itholic can we remove this?



-- 
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]

Reply via email to