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

   ### Apache Airflow version
   
   3.1.2
   
   ### If "Other Airflow 2/3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   The `.split()` method is called on `connection.host` which may be `None`
   According to Airflow's `Connection` model definition 
https://github.com/apache/airflow/blob/4a083b49aa67ee89ddc1cdbf82aa0babccd370a6/airflow-core/src/airflow/models/connection.py#L136
 , the `host` field type is `str | None` and is `nullable=True` in the 
database, so `connection.host` may be `None`.
   But the existing test 
[`test_openlineage_methods_with_redshift`](https://github.com/apache/airflow/blob/4a083b49aa67ee89ddc1cdbf82aa0babccd370a6/providers/postgres/tests/unit/postgres/hooks/test_postgres.py#L144-L175)
  only tests cases where `host` is a concrete string value, but does not test 
`host=None`. The test allows `port` to be `None` (line 128), but the `host` 
parameterization list does not include none values.
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   
https://github.com/apache/airflow/blob/4a083b49aa67ee89ddc1cdbf82aa0babccd370a6/airflow-core/src/airflow/models/connection.py#L136
   
https://github.com/apache/airflow/blob/4a083b49aa67ee89ddc1cdbf82aa0babccd370a6/providers/postgres/tests/unit/postgres/hooks/test_postgres.py#L144-L175
   
   
   ### Operating System
   
   macOS
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### 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