nija-at commented on code in PR #41866:
URL: https://github.com/apache/spark/pull/41866#discussion_r1253932386


##########
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:
   Would like to call this `SPARK_CONNECT_USER_AGENT_EXTRA`. 
   
   @grundprinzip - Is that acceptable to you?



##########
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:
   The value of the env var needs to be appended to the existing user agent, 
not replaced.



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