itholic commented on code in PR #46063:
URL: https://github.com/apache/spark/pull/46063#discussion_r1568413626
##########
python/pyspark/sql/column.py:
##########
@@ -175,46 +175,13 @@ def _bin_op(
["Column", Union["Column", "LiteralType", "DecimalLiteral",
"DateTimeLiteral"]], "Column"
]:
"""Create a method for given binary operator"""
- binary_operator_map = {
- "plus": "+",
- "minus": "-",
- "divide": "/",
- "multiply": "*",
- "mod": "%",
- "equalTo": "=",
- "lt": "<",
- "leq": "<=",
- "geq": ">=",
- "gt": ">",
- "eqNullSafe": "<=>",
- "bitwiseOR": "|",
- "bitwiseAND": "&",
- "bitwiseXOR": "^",
- # Just following JVM rule even if the names of source and target are
the same.
- "and": "and",
- "or": "or",
- }
def _(
self: "Column",
other: Union["Column", "LiteralType", "DecimalLiteral",
"DateTimeLiteral"],
) -> "Column":
jc = other._jc if isinstance(other, Column) else other
- if name in binary_operator_map:
- from pyspark.sql import SparkSession
-
- spark = SparkSession._getActiveSessionOrCreate()
- stack = list(reversed(inspect.stack()))
- depth = int(
- spark.conf.get("spark.sql.stackTracesInDataFrameContext") #
type: ignore[arg-type]
Review Comment:
Oh, yes we should. Just updated code to respect the config.
--
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]