Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loosen pinecone version #148

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ mypy:
.PHONY: check-safety
check-safety:
poetry check
# TODO remove numpy ignore flag when fixed
poetry run safety check --full-report -i 44715 -i 51668
# TODO remove pip ignore flag when fixed
poetry run safety check --full-report -i 62044 -i 70612
poetry run bandit -ll --recursive domino_data tests

.PHONY: lint
Expand Down
3 changes: 2 additions & 1 deletion domino_data/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import attr
import backoff
import httpx
from httpx._config import DEFAULT_TIMEOUT_CONFIG
from pyarrow import flight

from datasource_api_client.client import Client
Expand All @@ -26,7 +27,7 @@ def get_jwt_token(url: str) -> str:
Raises:
HTTPStatusError: if the API returns an error
"""
resp = httpx.get(f"{url}/access-token")
resp = httpx.get(f"{url}/access-token", timeout=DEFAULT_TIMEOUT_CONFIG)
resp.raise_for_status()
return resp.read().decode("ascii")

Expand Down
9 changes: 6 additions & 3 deletions domino_data/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import httpx
import pandas
import urllib3
from httpx._config import DEFAULT_TIMEOUT_CONFIG
from pyarrow import ArrowException, flight, parquet

import domino_data.configuration_gen
Expand Down Expand Up @@ -348,11 +349,13 @@ def http(self) -> httpx.Client:
DatasourceDtoDataSourceType.ADLSCONFIG.value,
DatasourceDtoDataSourceType.AZUREBLOBSTORAGECONFIG.value,
):
self._httpx = httpx.Client(headers=ADLS_HEADERS, verify=context)
self._httpx = httpx.Client(
headers=ADLS_HEADERS, verify=context, timeout=DEFAULT_TIMEOUT_CONFIG
)
elif self.datasource_type == DatasourceDtoDataSourceType.GENERICS3CONFIG.value:
self._httpx = httpx.Client(verify=False) # nosec
self._httpx = httpx.Client(verify=False, timeout=DEFAULT_TIMEOUT_CONFIG) # nosec
else:
self._httpx = httpx.Client(verify=context)
self._httpx = httpx.Client(verify=context, timeout=DEFAULT_TIMEOUT_CONFIG)
return self._httpx

def pool_manager(self) -> urllib3.PoolManager:
Expand Down
4 changes: 2 additions & 2 deletions domino_data/vectordb.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_host_from_settings(self, index, variables=None, servers=None):


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
"""Wrap the parameters to initialize a Pinecone 3.x and above client

Args:
datasource_name: the name of the Pinecone data source
Expand All @@ -82,7 +82,7 @@ def domino_pinecone3x_init_params(datasource_name: str) -> Dict[str, Union[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
"""Wrap the parameters to target an index in the Pinecone 3.x and above client

Args:
datasource_name: the name of the Pinecone data source
Expand Down
4,061 changes: 2,220 additions & 1,841 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "dominodatalab-data"
version = "5.12.0.dev1"
version = "6.0.0.dev1"
description = "Domino Data API for interacting with Domino Data features"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -43,14 +43,14 @@ classifiers = [ #! Update me
[tool.poetry.dependencies]
python = "^3.9"
pandas = ">=1.3.0"
httpx = ">=0.23.0"
httpx = ">=0.24.0"
attrs = ">=20.1.0"
python-dateutil = "^2.8.0"
pyarrow = ">=15.0.2"
loguru = "^0.5.3"
backoff = ">=1.11.1"
bson = "^0.5.10"
urllib3 = "^1.26.16"
urllib3 = ">=1.26.19,<3"

[tool.poetry.group.dev.dependencies]
Sphinx = "^5.3.0"
Expand All @@ -72,7 +72,7 @@ pytest-cov = "^4.1.0"
pytest-recording = "^0.12.2"
pyupgrade = "^2.38.4"
respx = "^0.20.1"
safety = "^2.3.5"
safety = ">=3"
sphinx-rtd-theme = "^1.2.2"
types-PyYAML = "^6.0.12.11"
types-python-dateutil = "^2.8.19.14"
Expand All @@ -83,7 +83,7 @@ feast = ">=0.36.0"
GitPython = "^3.1.41"

[tool.poetry.group.vectordbs.dependencies]
pinecone-client = "^2.2.4"
pinecone-client = ">=2.2.4,<5"

[tool.black]
# https://github.com/psf/black
Expand Down
28 changes: 14 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
anyio==4.3.0 ; python_version >= "3.9" and python_version < "4.0"
attrs==23.2.0 ; python_version >= "3.9" and python_version < "4.0"
anyio==4.6.2.post1 ; python_version >= "3.9" and python_version < "4.0"
attrs==24.2.0 ; python_version >= "3.9" and python_version < "4.0"
backoff==2.2.1 ; python_version >= "3.9" and python_version < "4.0"
bson==0.5.10 ; python_version >= "3.9" and python_version < "4.0"
certifi==2024.2.2 ; python_version >= "3.9" and python_version < "4.0"
certifi==2024.8.30 ; python_version >= "3.9" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32"
exceptiongroup==1.2.1 ; python_version >= "3.9" and python_version < "3.11"
exceptiongroup==1.2.2 ; python_version >= "3.9" and python_version < "3.11"
h11==0.14.0 ; python_version >= "3.9" and python_version < "4.0"
httpcore==1.0.5 ; python_version >= "3.9" and python_version < "4.0"
httpx==0.27.0 ; python_version >= "3.9" and python_version < "4.0"
idna==3.7 ; python_version >= "3.9" and python_version < "4.0"
httpcore==1.0.6 ; python_version >= "3.9" and python_version < "4.0"
httpx==0.27.2 ; python_version >= "3.9" and python_version < "4.0"
idna==3.10 ; python_version >= "3.9" and python_version < "4.0"
loguru==0.5.3 ; python_version >= "3.9" and python_version < "4.0"
numpy==1.24.4 ; python_version >= "3.9" and python_version < "4.0"
pandas==2.2.2 ; python_version >= "3.9" and python_version < "4.0"
pyarrow==16.0.0 ; python_version >= "3.9" and python_version < "4.0"
numpy==1.26.4 ; python_version >= "3.9" and python_version <= "3.11" or python_version >= "3.12" and python_version < "4.0"
pandas==2.2.3 ; python_version >= "3.9" and python_version < "4.0"
pyarrow==18.0.0 ; python_version >= "3.9" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.9" and python_version < "4.0"
pytz==2024.1 ; python_version >= "3.9" and python_version < "4.0"
pytz==2024.2 ; python_version >= "3.9" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.9" and python_version < "4.0"
sniffio==1.3.1 ; python_version >= "3.9" and python_version < "4.0"
typing-extensions==4.11.0 ; python_version >= "3.9" and python_version < "3.11"
tzdata==2024.1 ; python_version >= "3.9" and python_version < "4.0"
urllib3==1.26.18 ; python_version >= "3.9" and python_version < "4.0"
typing-extensions==4.12.2 ; python_version >= "3.9" and python_version < "3.11"
tzdata==2024.2 ; python_version >= "3.9" and python_version < "4.0"
urllib3==1.26.20 ; python_version >= "3.9" and python_version < "4.0"
win32-setctime==1.1.0 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32"
8 changes: 4 additions & 4 deletions tests/test_vectordb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def test_get_host_from_setting():
test_data_api_gateway = "http://test_domino_api_gateway:9999"

domino_conf = DominoPineconeConfiguration(datasource=test_data_source)
assert domino_conf.host == "http://unknown-unknown.svc.unknown.pinecone.io"
assert domino_conf.host == "http://api.pinecone.io"
assert domino_conf.proxy == "http://127.0.0.1:8766"
assert domino_conf.proxy_headers["X-Domino-Datasource"] == test_data_source

os.environ["DOMINO_DATA_API_GATEWAY"] = test_data_api_gateway
domino_conf = DominoPineconeConfiguration(datasource=test_data_source)
assert domino_conf.host == f"http://unknown-unknown.svc.unknown.pinecone.io"
assert domino_conf.host == f"http://api.pinecone.io"
assert domino_conf.proxy == test_data_api_gateway
assert domino_conf.proxy_headers["X-Domino-Datasource"] == test_data_source

Expand All @@ -37,10 +37,10 @@ def test_get_host_from_setting():
"environment": test_environment,
},
)
assert host == "http://test_index-test_project.svc.test_environment.pinecone.io"
assert host == "http://api.pinecone.io"

host = domino_conf.get_host_from_settings(None, variables={})
assert host == f"http://unknown-unknown.svc.unknown.pinecone.io"
assert host == f"http://api.pinecone.io"


def test_get_domino_pinecone3x_init_params():
Expand Down
Loading