dabla commented on PR #40751:
URL: https://github.com/apache/airflow/pull/40751#issuecomment-2286282577

   > I'm a bit puzzled why I get following errors wiht provider compatibility 
tests as I didn't do any changes in Airflow itself I would assume it should be 
fine:
   > 
   > ```
   > Traceback (most recent call last):
   >   File 
"/usr/local/lib/python3.8/site-packages/airflow/models/connection.py", line 
466, in get_connection_from_secrets
   >     conn = secrets_backend.get_connection(conn_id=conn_id)
   >   File "/usr/local/lib/python3.8/site-packages/airflow/utils/session.py", 
line 78, in wrapper
   >     with create_session() as session:
   >   File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
   >     return next(self.gen)
   >   File "/usr/local/lib/python3.8/site-packages/airflow/utils/session.py", 
line 35, in create_session
   >     raise RuntimeError("Session must be set before!")
   > RuntimeError: Session must be set before!
   > Unable to retrieve connection from secrets backend (MetastoreBackend). 
Checking subsequent secrets backend.
   > Traceback (most recent call last):
   >   File 
"/usr/local/lib/python3.8/site-packages/airflow/models/connection.py", line 
466, in get_connection_from_secrets
   >     conn = secrets_backend.get_connection(conn_id=conn_id)
   >   File "/usr/local/lib/python3.8/site-packages/airflow/utils/session.py", 
line 78, in wrapper
   >     with create_session() as session:
   >   File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
   >     return next(self.gen)
   >   File "/usr/local/lib/python3.8/site-packages/airflow/utils/session.py", 
line 35, in create_session
   >     raise RuntimeError("Session must be set before!")
   > RuntimeError: Session must be set before!
   > Could not write logs to wasb://container/remote/log/location/1.log
   > Traceback (most recent call last):
   >   File 
"/usr/local/lib/python3.8/site-packages/airflow/providers/microsoft/azure/log/wasb_task_handler.py",
 line 210, in wasb_write
   >     self.hook.load_string(log, self.wasb_container, remote_log_location, 
overwrite=True)
   >   File 
"/usr/local/lib/python3.8/site-packages/airflow/providers/microsoft/azure/hooks/wasb.py",
 line 360, in load_string
   >     self.upload(
   >   File 
"/usr/local/lib/python3.8/site-packages/airflow/providers/microsoft/azure/hooks/wasb.py",
 line 417, in upload
   >     blob_client = self._get_blob_client(container_name, blob_name)
   >   File 
"/usr/local/lib/python3.8/site-packages/airflow/providers/microsoft/azure/hooks/wasb.py",
 line 232, in _get_blob_client
   >     return 
self.blob_service_client.get_blob_client(container=container_name, 
blob=blob_name)
   >   File "/usr/local/lib/python3.8/functools.py", line 967, in __get__
   >     val = self.func(instance)
   >   File 
"/usr/local/lib/python3.8/site-packages/airflow/providers/microsoft/azure/hooks/wasb.py",
 line 157, in blob_service_client
   >     return self.get_conn()
   >   File 
"/usr/local/lib/python3.8/site-packages/airflow/providers/microsoft/azure/hooks/wasb.py",
 line 161, in get_conn
   >     conn = self.get_connection(self.conn_id)
   >   File "/usr/local/lib/python3.8/site-packages/airflow/hooks/base.py", 
line 72, in get_connection
   >     conn = Connection.get_connection_from_secrets(conn_id)
   >   File 
"/usr/local/lib/python3.8/site-packages/airflow/models/connection.py", line 
477, in get_connection_from_secrets
   >     raise AirflowNotFoundException(f"The conn_id `{conn_id}` isn't 
defined")
   > airflow.exceptions.AirflowNotFoundException: The conn_id `` isn't defined
   > {"asctime": "2024-08-05T14:56:44.959+0000", "filename": "", "lineno": 0, 
"levelname": "Level None", "message": "end_of_log", "exc_text": null, "offset": 
1722869804959604736, "dag_id": "dag_for_testing_es_task_handler", "task_id": 
"task_for_testing_es_log_handler", "execution_date": 
"2016_01_01T00_00_00_000000", "try_number": "1", "log_id": 
"dag_for_testing_es_task_handler-task_for_testing_es_log_handler-2016_01_01T00_00_00_000000-1"}
   > ```
   
   This issue was related to the removed deepcopy, the deepcopy is apparently 
necessary for PostgresHook, so putted it back there and not in DbApiHook which 
fixes the tests.


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