Skip to content

Commit

Permalink
switch to string formatting to avoid operator error
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronHsu committed Oct 29, 2021
1 parent 6f8675e commit 82898e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/pyspark/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def setExecutorEnv(self, key: Optional[str] = None, value: Optional[str] = None,
if (key is not None and pairs is not None) or (key is None and pairs is None):
raise RuntimeError("Either pass one key-value pair or a list of pairs")
elif key is not None:
self.set("spark.executorEnv." + key, cast(str, value))
self.set("spark.executorEnv.{}".format(key), cast(str, value))
elif pairs is not None:
for (k, v) in pairs:
self.set("spark.executorEnv." + k, v)
self.set("spark.executorEnv.{}".format(k), v)
return self

def setAll(self, pairs: List[Tuple[str, str]]) -> "SparkConf":
Expand Down

0 comments on commit 82898e0

Please sign in to comment.