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

   ### Apache Airflow version
   
   3.1.3
   
   ### If "Other Airflow 2/3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   When instantiating a `CloudSqlDatabaseHook` 
[here](https://github.com/apache/airflow/blob/a2c95d025f0894747431b1681ce515f1f2e84aba/airflow/gcp/hooks/cloud_sql.py#L777)
 we can see that the `public_ip` attribute gets populated from the host 
provided in the connection.
   
   I'm using a `Cloud SQL Database` connection, originally without a host.
   
   This then leads to 
[here](https://github.com/apache/airflow/blob/a2c95d025f0894747431b1681ce515f1f2e84aba/airflow/gcp/hooks/cloud_sql.py#L916-L917)
 where an error will be raised. 
   
   The error message "The location parameter needs to be set in connection" is 
incorrect and misleading. It should say something related to the public IP / 
host being missing.
   
   ### What you think should happen instead?
   
   The error message should say "The host needs to be set in connection" OR 
"The public IP derived from the host set in connection is missing"
   
   ### How to reproduce
   
   1. Create a "Cloud SQL Database" connection in airflow without a host
   2. Use a DAG with a `CloudSQLExecuteQueryOperator` referencing to that 
connection with the `gcp_cloudsql_conn_id` parameter
   3. Voilaa
   
   ### Operating System
   
   OS X 14.4.1 (23E224)
   
   ### Versions of Apache Airflow Providers
   
   19.1
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### 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](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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