dillitz commented on code in PR #41866:
URL: https://github.com/apache/spark/pull/41866#discussion_r1254107904


##########
python/pyspark/sql/connect/client/core.py:
##########
@@ -296,7 +296,10 @@ def userAgent(self) -> str:
             or "_SPARK_CONNECT_PYTHON" when not specified.
             The returned value will be percent encoded.
         """
-        user_agent = self.params.get(ChannelBuilder.PARAM_USER_AGENT, 
"_SPARK_CONNECT_PYTHON")
+        user_agent = self.params.get(
+            ChannelBuilder.PARAM_USER_AGENT,
+            os.getenv("SPARK_CONNECT_USER_AGENT", "_SPARK_CONNECT_PYTHON"),

Review Comment:
   It gets prepended 
[here](https://github.com/apache/spark/blob/8d046de2cf2fe428c3eff1696f899eff30d0b4b7/python/pyspark/sql/connect/client/core.py#L290)
 to the rest of the current `userAgent`. The environment variable only gets 
used as a fallback option if the user did not specify their own user_agent in 
the provided `ChannelBuilder`.



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