This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new d048122eb1 Fix mypy problems in new waeviate client (#40330)
d048122eb1 is described below

commit d048122eb1899a5d5d16ad67b876d7e7c6982e66
Author: Jarek Potiuk <[email protected]>
AuthorDate: Wed Jun 19 20:47:43 2024 +0200

    Fix mypy problems in new waeviate client (#40330)
    
    The new waeviate client (4.6.5) has more typing information and it
    causes Waeviate Hook to fail mypy check. This PR fixes it.
---
 airflow/providers/weaviate/hooks/weaviate.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/airflow/providers/weaviate/hooks/weaviate.py 
b/airflow/providers/weaviate/hooks/weaviate.py
index b0c8b8793c..56c7f66633 100644
--- a/airflow/providers/weaviate/hooks/weaviate.py
+++ b/airflow/providers/weaviate/hooks/weaviate.py
@@ -120,7 +120,9 @@ class WeaviateHook(BaseHook):
         additional_headers = extras.pop("additional_headers", {})
         scope = extras.get("scope", None) or extras.get("oidc_scope", None)
         if api_key:
-            auth_client_secret = AuthApiKey(api_key)
+            auth_client_secret: AuthApiKey | AuthBearerToken | 
AuthClientCredentials | AuthClientPassword = (
+                AuthApiKey(api_key)
+            )
         elif access_token:
             auth_client_secret = AuthBearerToken(
                 access_token, expires_in=expires_in, 
refresh_token=refresh_token

Reply via email to