From 125436c5075f922096115ac0dbf839adbaafca28 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Jun 2024 03:55:53 +0200 Subject: [PATCH 1/7] chore(deps): update python-nonmajor (#141) * chore(deps): update python-nonmajor * Update pyproject.toml --------- Co-authored-by: Averi Kitsch --- pyproject.toml | 3 +-- requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 378a771c..293e4266 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,8 +13,7 @@ dependencies = [ "cloud-sql-python-connector[asyncpg] >= 1.7.0, <2.0.0", "langchain-core>=0.1.1, <1.0.0 ", "langchain-community>=0.0.18, <0.3.0", - "numpy==1.24.4; python_version<='3.8'", - "numpy>=1.24.4, <2.0.0; python_version>'3.8'", + "numpy>=1.24.4, <2.0.0", "pgvector>=0.2.5, <1.0.0", "SQLAlchemy[asyncio]>=2.0.25, <3.0.0" ] diff --git a/requirements.txt b/requirements.txt index db27ab05..6fbca3d9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -cloud-sql-python-connector[asyncpg]==1.9.2 -langchain-core==0.2.2 +cloud-sql-python-connector[asyncpg]==1.10.0 +langchain-core==0.2.7 langchain-community==0.2.1 numpy===1.24.4; python_version<='3.8' numpy==1.26.4; python_version>'3.8' From e03c2316a704616fca8a2de56c5d2087f48591dc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Jun 2024 04:01:07 +0200 Subject: [PATCH 2/7] chore(deps): update dependency langchain-community to v0.2.5 [security] (#139) Co-authored-by: Averi Kitsch --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6fbca3d9..ec40d805 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ cloud-sql-python-connector[asyncpg]==1.10.0 langchain-core==0.2.7 -langchain-community==0.2.1 +langchain-community==0.2.5 numpy===1.24.4; python_version<='3.8' numpy==1.26.4; python_version>'3.8' pgvector==0.2.5 From 59df24b4ebd6647604ec987daaafa6c2edd4aea7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:03:35 -0700 Subject: [PATCH 3/7] chore(deps): bump urllib3 from 2.2.1 to 2.2.2 in /.kokoro (#142) Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.1 to 2.2.2. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.2.1...2.2.2) --- updated-dependencies: - dependency-name: urllib3 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Averi Kitsch --- .kokoro/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 7eb2ec20..ad774a65 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -502,9 +502,9 @@ typing-extensions==4.10.0 \ --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \ --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb # via -r requirements.in -urllib3==2.2.1 \ - --hash=sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d \ - --hash=sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19 +urllib3==2.2.2 \ + --hash=sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472 \ + --hash=sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168 # via # requests # twine From 4f950b90b53b7e1943744ab95a00cd6b4045a892 Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Tue, 18 Jun 2024 10:30:03 -0700 Subject: [PATCH 4/7] feat: add support for quota project (#137) * feat: add support for quota project * lint * update tests * lint --- src/langchain_google_cloud_sql_pg/engine.py | 9 ++++++++- tests/test_postgresql_engine.py | 1 + tests/test_postgresql_loader.py | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/langchain_google_cloud_sql_pg/engine.py b/src/langchain_google_cloud_sql_pg/engine.py index d24126d1..ae353d70 100644 --- a/src/langchain_google_cloud_sql_pg/engine.py +++ b/src/langchain_google_cloud_sql_pg/engine.py @@ -112,6 +112,7 @@ def from_instance( user: Optional[str] = None, password: Optional[str] = None, ip_type: Union[str, IPTypes] = IPTypes.PUBLIC, + quota_project: Optional[str] = None, ) -> PostgresEngine: # Running a loop in a background thread allows us to support # async methods from non-async environments @@ -128,6 +129,7 @@ def from_instance( password, loop=loop, thread=thread, + quota_project=quota_project, ) return asyncio.run_coroutine_threadsafe(coro, loop).result() @@ -143,6 +145,7 @@ async def _create( password: Optional[str] = None, loop: Optional[asyncio.AbstractEventLoop] = None, thread: Optional[Thread] = None, + quota_project: Optional[str] = None, ) -> PostgresEngine: if bool(user) ^ bool(password): raise ValueError( @@ -152,7 +155,9 @@ async def _create( ) if cls._connector is None: cls._connector = Connector( - loop=asyncio.get_event_loop(), user_agent=USER_AGENT + loop=asyncio.get_event_loop(), + user_agent=USER_AGENT, + quota_project=quota_project, ) # if user and password are given, use basic auth @@ -197,6 +202,7 @@ async def afrom_instance( user: Optional[str] = None, password: Optional[str] = None, ip_type: Union[str, IPTypes] = IPTypes.PUBLIC, + quota_project: Optional[str] = None, ) -> PostgresEngine: return await cls._create( project_id, @@ -206,6 +212,7 @@ async def afrom_instance( ip_type, user, password, + quota_project=quota_project, ) @classmethod diff --git a/tests/test_postgresql_engine.py b/tests/test_postgresql_engine.py index 8c08a238..50265731 100644 --- a/tests/test_postgresql_engine.py +++ b/tests/test_postgresql_engine.py @@ -270,6 +270,7 @@ async def test_password( database=db_name, user=user, password=password, + quota_project=db_project, ) assert engine engine._execute("SELECT 1") diff --git a/tests/test_postgresql_loader.py b/tests/test_postgresql_loader.py index 49b11de9..d295c027 100644 --- a/tests/test_postgresql_loader.py +++ b/tests/test_postgresql_loader.py @@ -38,6 +38,7 @@ class TestLoaderAsync: @pytest_asyncio.fixture async def engine(self): + PostgresEngine._connector = None engine = await PostgresEngine.afrom_instance( project_id=project_id, instance=instance_id, @@ -48,6 +49,7 @@ async def engine(self): @pytest_asyncio.fixture def sync_engine(self): + PostgresEngine._connector = None engine = PostgresEngine.from_instance( project_id=project_id, instance=instance_id, @@ -734,6 +736,7 @@ async def test_delete_doc_with_customized_metadata( assert len(await self._collect_async_items(loader.alazy_load())) == 0 def test_sync_engine(self): + PostgresEngine._connector = None engine = PostgresEngine.from_instance( project_id=project_id, instance=instance_id, From 17129b3ee70f5fb6cfc8038254050ae5aa7e9b1f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Jun 2024 21:22:55 +0200 Subject: [PATCH 5/7] chore(deps): update dependency test/pytest to v8 (#136) Co-authored-by: Averi Kitsch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 293e4266..8f079a8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ test = [ "isort==5.13.2", "mypy==1.10.0", "pytest-asyncio==0.23.7", - "pytest==7.4.4", + "pytest==8.2.2", "pytest-cov==5.0.0" ] From b370592100d443d9ebebf8e6920eff58c6652088 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Jun 2024 22:03:33 +0200 Subject: [PATCH 6/7] chore(deps): update dependency test/black to v24 (#135) Co-authored-by: Averi Kitsch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8f079a8a..d751674c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ Changelog = "https://github.com/googleapis/langchain-google-cloud-sql-pg-python/ [project.optional-dependencies] test = [ - "black[jupyter]==23.12.1", + "black[jupyter]==24.4.2", "isort==5.13.2", "mypy==1.10.0", "pytest-asyncio==0.23.7", From 8cc74dc6dfb255a7c6fed70a57c1d9306f23bd2d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:11:57 -0700 Subject: [PATCH 7/7] chore(main): release 0.6.0 (#143) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Averi Kitsch --- CHANGELOG.md | 7 +++++++ src/langchain_google_cloud_sql_pg/version.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51cc3777..69d06f8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.6.0](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/compare/v0.5.0...v0.6.0) (2024-06-18) + + +### Features + +* Add support for quota project ([#137](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/issues/137)) ([4f950b9](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/commit/4f950b90b53b7e1943744ab95a00cd6b4045a892)) + ## [0.5.0](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/compare/v0.4.1...v0.5.0) (2024-05-30) diff --git a/src/langchain_google_cloud_sql_pg/version.py b/src/langchain_google_cloud_sql_pg/version.py index 4f5353ed..7bf0f20b 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.5.0" +__version__ = "0.6.0"