peloyeje opened a new issue, #72102:
URL: https://github.com/apache/airflow/issues/72102

   ### Apache Airflow version
   
   2.11.0 (also reproduces on `main`, provider 7.19.0)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened
   
   Every call to `DatabricksSqlHook.get_conn()` (used by 
`DatabricksSqlOperator`, Databricks SQL sensors, etc.) logs this warning:
   
   ```
   [WARN] Parameter '_user_agent_entry' is deprecated; use 'user_agent_entry' 
instead. This parameter will be removed in the upcoming releases.
   ```
   
   Steps to reproduce:
   1. Set up a Databricks SQL connection.
   2. Run any task that opens a connection through `DatabricksSqlHook` (e.g. 
`DatabricksSqlOperator`).
   3. Check the task log. The warning fires on every new connection.
   
   Cause: 
[`databricks_sql.py`](https://github.com/apache/airflow/blob/main/providers/databricks/src/airflow/providers/databricks/hooks/databricks_sql.py)
 builds `connect_kwargs` with the key `_user_agent_entry` (leading underscore) 
when calling `sql.connect()`. `databricks-sql-connector`'s `Session.__init__` 
only reads `user_agent_entry` directly; it falls back to `_user_agent_entry` 
for backward compatibility and logs the deprecation warning each time it's used.
   
   ### What you think should happen instead
   
   The hook should pass `user_agent_entry` (no underscore), the current 
parameter name. This isn't a behavior change: `user_agent_entry` has been 
supported by `databricks-sql-connector` for multiple releases, and the provider 
on `main` already pins `databricks-sql-connector>=4.4.0`, well above where the 
non-underscore parameter was introduced.
   
   ### How to reproduce
   
   See steps above.
   
   ### Operating System
   
   Any (reproduces regardless of OS)
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-databricks==7.12.0
   databricks-sql-connector==4.2.5
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   I have a one-line fix ready and will open a PR against this issue.
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's Code of Conduct


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

Reply via email to