From cbae09466ac6d7f96dba795316ec758287aaea58 Mon Sep 17 00:00:00 2001 From: Jack Wotherspoon Date: Wed, 26 Jun 2024 16:12:26 -0400 Subject: [PATCH 1/5] fix: use lazy refresh for Cloud SQL Connector (#144) --- pyproject.toml | 2 +- src/langchain_google_cloud_sql_pg/engine.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d751674c..f816b08c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ ] dependencies = [ - "cloud-sql-python-connector[asyncpg] >= 1.7.0, <2.0.0", + "cloud-sql-python-connector[asyncpg] >= 1.10.0, <2.0.0", "langchain-core>=0.1.1, <1.0.0 ", "langchain-community>=0.0.18, <0.3.0", "numpy>=1.24.4, <2.0.0", diff --git a/src/langchain_google_cloud_sql_pg/engine.py b/src/langchain_google_cloud_sql_pg/engine.py index ae353d70..4662b27e 100644 --- a/src/langchain_google_cloud_sql_pg/engine.py +++ b/src/langchain_google_cloud_sql_pg/engine.py @@ -22,7 +22,7 @@ import aiohttp import google.auth # type: ignore import google.auth.transport.requests # type: ignore -from google.cloud.sql.connector import Connector, IPTypes +from google.cloud.sql.connector import Connector, IPTypes, RefreshStrategy from sqlalchemy import MetaData, Table, text from sqlalchemy.exc import InvalidRequestError from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine @@ -158,6 +158,7 @@ async def _create( loop=asyncio.get_event_loop(), user_agent=USER_AGENT, quota_project=quota_project, + refresh_strategy=RefreshStrategy.LAZY, ) # if user and password are given, use basic auth From e6e97abc41366eb326b986ecffdd9c09b75c90c8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Jun 2024 00:16:37 +0200 Subject: [PATCH 2/5] chore(deps): update python-nonmajor (#146) --- pyproject.toml | 2 +- requirements.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f816b08c..8facf43d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ Changelog = "https://github.com/googleapis/langchain-google-cloud-sql-pg-python/ test = [ "black[jupyter]==24.4.2", "isort==5.13.2", - "mypy==1.10.0", + "mypy==1.10.1", "pytest-asyncio==0.23.7", "pytest==8.2.2", "pytest-cov==5.0.0" diff --git a/requirements.txt b/requirements.txt index ec40d805..4ccd0236 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ cloud-sql-python-connector[asyncpg]==1.10.0 -langchain-core==0.2.7 -langchain-community==0.2.5 +langchain-core==0.2.10 +langchain-community==0.2.6 numpy===1.24.4; python_version<='3.8' numpy==1.26.4; python_version>'3.8' -pgvector==0.2.5 -SQLAlchemy[asyncio]==2.0.30 +pgvector==0.3.0 +SQLAlchemy[asyncio]==2.0.31 From 45854a17929b07653acb641243db695f4cef9c7e Mon Sep 17 00:00:00 2001 From: Wenxin Du <117315983+duwenxin99@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:47:53 -0400 Subject: [PATCH 3/5] fix: Change IVFFlat `lists` default to 100 (#149) --- src/langchain_google_cloud_sql_pg/indexes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/langchain_google_cloud_sql_pg/indexes.py b/src/langchain_google_cloud_sql_pg/indexes.py index 8a8432f6..0cf9b941 100644 --- a/src/langchain_google_cloud_sql_pg/indexes.py +++ b/src/langchain_google_cloud_sql_pg/indexes.py @@ -85,7 +85,7 @@ def to_string(self): @dataclass class IVFFlatIndex(BaseIndex): index_type: str = "ivfflat" - lists: int = 1 + lists: int = 100 def index_options(self) -> str: return f"(lists = {self.lists})" From 7ce9f800ac72d3e363d7704d0d65871195bd0bfb Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Mon, 1 Jul 2024 09:05:47 -0700 Subject: [PATCH 4/5] docs: update API reference link (#147) --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index bb534ed4..17a6e652 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ Cloud SQL for PostgreSQL for LangChain :target: https://pypi.org/project/langchain-google-cloud-sql-pg/ .. |versions| image:: https://img.shields.io/pypi/pyversions/langchain-google-cloud-sql-pg.svg :target: https://pypi.org/project/langchain-google-cloud-sql-pg/ -.. _Client Library Documentation: https://github.com/googleapis/langchain-google-cloud-sql-pg-python +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest .. _Product Documentation: https://cloud.google.com/sql/docs Quick Start @@ -167,4 +167,4 @@ information. Disclaimer ~~~~~~~~~~~ -This is not an officially supported Google product. \ No newline at end of file +This is not an officially supported Google product. From 424e7c941402ef5f8093d78b13bc37a5a042bdec Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 09:12:20 -0700 Subject: [PATCH 5/5] chore(main): release 0.6.1 (#145) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ src/langchain_google_cloud_sql_pg/version.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69d06f8e..69779e92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [0.6.1](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/compare/v0.6.0...v0.6.1) (2024-07-01) + + +### Bug Fixes + +* Change IVFFlat `lists` default to 100 ([#149](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/issues/149)) ([45854a1](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/commit/45854a17929b07653acb641243db695f4cef9c7e)) +* Use lazy refresh for Cloud SQL Connector ([#144](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/issues/144)) ([cbae094](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/commit/cbae09466ac6d7f96dba795316ec758287aaea58)) + + +### Documentation + +* Update API reference link ([#147](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/issues/147)) ([7ce9f80](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/commit/7ce9f800ac72d3e363d7704d0d65871195bd0bfb)) + ## [0.6.0](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/compare/v0.5.0...v0.6.0) (2024-06-18) diff --git a/src/langchain_google_cloud_sql_pg/version.py b/src/langchain_google_cloud_sql_pg/version.py index 7bf0f20b..dc3d1e82 100644 --- a/src/langchain_google_cloud_sql_pg/version.py +++ b/src/langchain_google_cloud_sql_pg/version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.6.0" +__version__ = "0.6.1"