Skip to content

Commit

Permalink
Retry getting jwt token for reading timeout (#141)
Browse files Browse the repository at this point in the history
* Retry getting jwt token for reading timeout

* updated dependencies

* Fixed the test failure

* fixed the style error

* fixed the vulnerability in fastapi

Have to loosen the version of openapi-client to solve pydantic version conflicts.
  • Loading branch information
ddl-joyce-zhao authored Apr 3, 2024
1 parent 8b489b0 commit cecd0ac
Show file tree
Hide file tree
Showing 5 changed files with 857 additions and 752 deletions.
1 change: 1 addition & 0 deletions domino_data/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


@backoff.on_exception(backoff.expo, httpx.HTTPStatusError, max_time=2)
@backoff.on_exception(backoff.expo, httpx.ReadTimeout, max_tries=2)
def get_jwt_token(url: str) -> str:
"""Gets a domino token from local sidecar API.
Expand Down
8 changes: 5 additions & 3 deletions domino_data/vectordb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict
from typing import Dict, Union

import os

Expand Down Expand Up @@ -63,7 +63,7 @@ def get_host_from_settings(self, index, variables=None, servers=None):
return url.replace("https://", "http://")


def domino_pinecone3x_init_params(datasource_name: str) -> Dict[str, str]:
def domino_pinecone3x_init_params(datasource_name: str) -> Dict[str, Union[str, Dict[str, str]]]:
"""Wrap the parameters to initialize a Pinecone 3.x client
Args:
Expand All @@ -79,7 +79,9 @@ def domino_pinecone3x_init_params(datasource_name: str) -> Dict[str, str]:
}


def domino_pinecone3x_index_params(datasource_name: str, index_name: str) -> Dict[str, str]:
def domino_pinecone3x_index_params(
datasource_name: str, index_name: str
) -> Dict[str, Union[str, Dict[str, str]]]:
"""Wrap the parameters to target an index in the Pinecone 3.x client
Args:
Expand Down
Loading

0 comments on commit cecd0ac

Please sign in to comment.