nailo2c commented on issue #51499:
URL: https://github.com/apache/airflow/issues/51499#issuecomment-2954303348

   Hi, I'm unable to reproduce the error, although my setup is slightly 
different from yours.
   
   I started Airflow using Breeze on my Mac and launched a Redis instance using 
Docker, then connected them to the same network.
   
   And I followed your code, it works on my side.
   
   ```python
   >>> from airflow.providers.redis.hooks.redis import RedisHook
   >>> # Get Redis connection from Airflow connection
   >>> redis_hook = RedisHook(redis_conn_id="redis")
   >>> 
   >>> # Get connection parameters for logging
   >>> conn_params = redis_hook.get_connection(redis_hook.redis_conn_id)
   [2025-06-08T22:10:22.335+0000] {base.py:65} INFO - Connection Retrieved 
'redis'
   >>> print(f"Redis connection parameters: host={conn_params.host}, 
port={conn_params.port}, password {conn_params.password}")
   Redis connection parameters: host=redis, port=6379, password None
   >>> 
   >>> print("Getting redis client using redis_hook.get_conn()")
   Getting redis client using redis_hook.get_conn()
   >>> redis_client = redis_hook.get_conn()
   [2025-06-08T22:10:22.338+0000] {base.py:65} INFO - Connection Retrieved 
'redis'
   >>> print("Successfully connected to Redis")
   Successfully connected to Redis
   >>> # Test connection with ping
   >>> print("Pinging Redis to test connection...")
   Pinging Redis to test connection...
   >>> ping_result = redis_client.ping()
   >>> print(f"Redis ping result: {ping_result}")
   Redis ping result: True
   >>> 
   ```
   
   Here is my module version:
   ```console
   root@81c3ed4d345b:/opt/airflow# pip freeze | grep redis
   apache-airflow-providers-redis==4.1.0
   google-cloud-redis==2.18.1
   redis==5.2.1
   ```
   
   Airflow Version: 3.1.0
   
   Which `docker-compose.yml` you used, is there a link?
   What's the output of `airflow connections get redis --output json` from your 
side?


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