langgraph-checkpoint-postgres 2.0.24__tar.gz → 2.0.25__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/PKG-INFO +2 -2
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/checkpoint/postgres/__init__.py +2 -2
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/checkpoint/postgres/aio.py +2 -2
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/checkpoint/postgres/base.py +14 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/checkpoint/postgres/shallow.py +3 -3
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/pyproject.toml +2 -2
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/test_async.py +0 -4
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/test_sync.py +0 -4
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/uv.lock +2 -2
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/.gitignore +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/Makefile +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/README.md +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/checkpoint/postgres/_ainternal.py +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/checkpoint/postgres/_internal.py +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/checkpoint/postgres/py.typed +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/store/postgres/__init__.py +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/store/postgres/aio.py +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/store/postgres/base.py +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/langgraph/store/postgres/py.typed +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/__init__.py +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/compose-postgres.yml +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/conftest.py +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/embed_test_utils.py +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/test_async_store.py +0 -0
- {langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/test_store.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langgraph-checkpoint-postgres
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.25
|
|
4
4
|
Summary: Library with a Postgres implementation of LangGraph checkpoint saver.
|
|
5
5
|
Project-URL: Repository, https://www.github.com/langchain-ai/langgraph
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Requires-Python: >=3.9
|
|
8
|
-
Requires-Dist: langgraph-checkpoint<3.0.0,>=2.
|
|
8
|
+
Requires-Dist: langgraph-checkpoint<3.0.0,>=2.1.2
|
|
9
9
|
Requires-Dist: orjson>=3.10.1
|
|
10
10
|
Requires-Dist: psycopg-pool>=3.2.0
|
|
11
11
|
Requires-Dist: psycopg>=3.2.0
|
|
@@ -14,7 +14,7 @@ from langgraph.checkpoint.base import (
|
|
|
14
14
|
CheckpointMetadata,
|
|
15
15
|
CheckpointTuple,
|
|
16
16
|
get_checkpoint_id,
|
|
17
|
-
|
|
17
|
+
get_serializable_checkpoint_metadata,
|
|
18
18
|
)
|
|
19
19
|
from langgraph.checkpoint.serde.base import SerializerProtocol
|
|
20
20
|
from psycopg import Capabilities, Connection, Cursor, Pipeline
|
|
@@ -325,7 +325,7 @@ class PostgresSaver(BasePostgresSaver):
|
|
|
325
325
|
checkpoint["id"],
|
|
326
326
|
checkpoint_id,
|
|
327
327
|
Jsonb(copy),
|
|
328
|
-
Jsonb(
|
|
328
|
+
Jsonb(get_serializable_checkpoint_metadata(config, metadata)),
|
|
329
329
|
),
|
|
330
330
|
)
|
|
331
331
|
return next_config
|
|
@@ -14,7 +14,7 @@ from langgraph.checkpoint.base import (
|
|
|
14
14
|
CheckpointMetadata,
|
|
15
15
|
CheckpointTuple,
|
|
16
16
|
get_checkpoint_id,
|
|
17
|
-
|
|
17
|
+
get_serializable_checkpoint_metadata,
|
|
18
18
|
)
|
|
19
19
|
from langgraph.checkpoint.serde.base import SerializerProtocol
|
|
20
20
|
from psycopg import AsyncConnection, AsyncCursor, AsyncPipeline, Capabilities
|
|
@@ -283,7 +283,7 @@ class AsyncPostgresSaver(BasePostgresSaver):
|
|
|
283
283
|
checkpoint["id"],
|
|
284
284
|
checkpoint_id,
|
|
285
285
|
Jsonb(copy),
|
|
286
|
-
Jsonb(
|
|
286
|
+
Jsonb(get_serializable_checkpoint_metadata(config, metadata)),
|
|
287
287
|
),
|
|
288
288
|
)
|
|
289
289
|
return next_config
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import random
|
|
4
|
+
import warnings
|
|
4
5
|
from collections.abc import Sequence
|
|
6
|
+
from importlib.metadata import version as get_version
|
|
5
7
|
from typing import Any, Optional, cast
|
|
6
8
|
|
|
7
9
|
from langchain_core.runnables import RunnableConfig
|
|
@@ -16,6 +18,18 @@ from psycopg.types.json import Jsonb
|
|
|
16
18
|
|
|
17
19
|
MetadataInput = Optional[dict[str, Any]]
|
|
18
20
|
|
|
21
|
+
try:
|
|
22
|
+
major, minor = get_version("langgraph").split(".")[:2]
|
|
23
|
+
if int(major) == 0 and int(minor) < 5:
|
|
24
|
+
warnings.warn(
|
|
25
|
+
"You're using incompatible versions of langgraph and checkpoint-postgres. Please upgrade langgraph to avoid unexpected behavior.",
|
|
26
|
+
DeprecationWarning,
|
|
27
|
+
stacklevel=2,
|
|
28
|
+
)
|
|
29
|
+
except Exception:
|
|
30
|
+
# skip version check if running from source
|
|
31
|
+
pass
|
|
32
|
+
|
|
19
33
|
"""
|
|
20
34
|
To add a new migration, add a new string to the MIGRATIONS list.
|
|
21
35
|
The position of the migration in the list is the version number.
|
|
@@ -12,7 +12,7 @@ from langgraph.checkpoint.base import (
|
|
|
12
12
|
Checkpoint,
|
|
13
13
|
CheckpointMetadata,
|
|
14
14
|
CheckpointTuple,
|
|
15
|
-
|
|
15
|
+
get_serializable_checkpoint_metadata,
|
|
16
16
|
)
|
|
17
17
|
from langgraph.checkpoint.serde.base import SerializerProtocol
|
|
18
18
|
from langgraph.checkpoint.serde.types import TASKS
|
|
@@ -441,7 +441,7 @@ class ShallowPostgresSaver(BasePostgresSaver):
|
|
|
441
441
|
thread_id,
|
|
442
442
|
checkpoint_ns,
|
|
443
443
|
Jsonb(copy),
|
|
444
|
-
Jsonb(
|
|
444
|
+
Jsonb(get_serializable_checkpoint_metadata(config, metadata)),
|
|
445
445
|
),
|
|
446
446
|
)
|
|
447
447
|
return next_config
|
|
@@ -774,7 +774,7 @@ class AsyncShallowPostgresSaver(BasePostgresSaver):
|
|
|
774
774
|
thread_id,
|
|
775
775
|
checkpoint_ns,
|
|
776
776
|
Jsonb(copy),
|
|
777
|
-
Jsonb(
|
|
777
|
+
Jsonb(get_serializable_checkpoint_metadata(config, metadata)),
|
|
778
778
|
),
|
|
779
779
|
)
|
|
780
780
|
return next_config
|
{langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/pyproject.toml
RENAMED
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "langgraph-checkpoint-postgres"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.25"
|
|
8
8
|
description = "Library with a Postgres implementation of LangGraph checkpoint saver."
|
|
9
9
|
authors = []
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -12,7 +12,7 @@ readme = "README.md"
|
|
|
12
12
|
license = "MIT"
|
|
13
13
|
license-files = ['LICENSE']
|
|
14
14
|
dependencies = [
|
|
15
|
-
"langgraph-checkpoint>=2.
|
|
15
|
+
"langgraph-checkpoint>=2.1.2,<3.0.0",
|
|
16
16
|
"orjson>=3.10.1",
|
|
17
17
|
"psycopg>=3.2.0",
|
|
18
18
|
"psycopg-pool>=3.2.0",
|
{langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/test_async.py
RENAMED
|
@@ -187,13 +187,11 @@ def test_data():
|
|
|
187
187
|
metadata_1: CheckpointMetadata = {
|
|
188
188
|
"source": "input",
|
|
189
189
|
"step": 2,
|
|
190
|
-
"writes": {},
|
|
191
190
|
"score": 1,
|
|
192
191
|
}
|
|
193
192
|
metadata_2: CheckpointMetadata = {
|
|
194
193
|
"source": "loop",
|
|
195
194
|
"step": 1,
|
|
196
|
-
"writes": {"foo": "bar"},
|
|
197
195
|
"score": None,
|
|
198
196
|
}
|
|
199
197
|
metadata_3: CheckpointMetadata = {}
|
|
@@ -220,7 +218,6 @@ async def test_combined_metadata(saver_name: str, test_data) -> None:
|
|
|
220
218
|
metadata: CheckpointMetadata = {
|
|
221
219
|
"source": "loop",
|
|
222
220
|
"step": 1,
|
|
223
|
-
"writes": {"foo": "bar"},
|
|
224
221
|
"score": None,
|
|
225
222
|
}
|
|
226
223
|
await saver.aput(config, chkpnt, metadata, {})
|
|
@@ -246,7 +243,6 @@ async def test_asearch(saver_name: str, test_data) -> None:
|
|
|
246
243
|
query_1 = {"source": "input"} # search by 1 key
|
|
247
244
|
query_2 = {
|
|
248
245
|
"step": 1,
|
|
249
|
-
"writes": {"foo": "bar"},
|
|
250
246
|
} # search by multiple keys
|
|
251
247
|
query_3: dict[str, Any] = {} # search by no keys, return all checkpoints
|
|
252
248
|
query_4 = {"source": "update", "step": 1} # no match
|
{langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/test_sync.py
RENAMED
|
@@ -169,13 +169,11 @@ def test_data():
|
|
|
169
169
|
metadata_1: CheckpointMetadata = {
|
|
170
170
|
"source": "input",
|
|
171
171
|
"step": 2,
|
|
172
|
-
"writes": {},
|
|
173
172
|
"score": 1,
|
|
174
173
|
}
|
|
175
174
|
metadata_2: CheckpointMetadata = {
|
|
176
175
|
"source": "loop",
|
|
177
176
|
"step": 1,
|
|
178
|
-
"writes": {"foo": "bar"},
|
|
179
177
|
"score": None,
|
|
180
178
|
}
|
|
181
179
|
metadata_3: CheckpointMetadata = {}
|
|
@@ -202,7 +200,6 @@ def test_combined_metadata(saver_name: str, test_data) -> None:
|
|
|
202
200
|
metadata: CheckpointMetadata = {
|
|
203
201
|
"source": "loop",
|
|
204
202
|
"step": 1,
|
|
205
|
-
"writes": {"foo": "bar"},
|
|
206
203
|
"score": None,
|
|
207
204
|
}
|
|
208
205
|
saver.put(config, chkpnt, metadata, {})
|
|
@@ -228,7 +225,6 @@ def test_search(saver_name: str, test_data) -> None:
|
|
|
228
225
|
query_1 = {"source": "input"} # search by 1 key
|
|
229
226
|
query_2 = {
|
|
230
227
|
"step": 1,
|
|
231
|
-
"writes": {"foo": "bar"},
|
|
232
228
|
} # search by multiple keys
|
|
233
229
|
query_3: dict[str, Any] = {} # search by no keys, return all checkpoints
|
|
234
230
|
query_4 = {"source": "update", "step": 1} # no match
|
|
@@ -245,7 +245,7 @@ wheels = [
|
|
|
245
245
|
|
|
246
246
|
[[package]]
|
|
247
247
|
name = "langgraph-checkpoint"
|
|
248
|
-
version = "2.1.
|
|
248
|
+
version = "2.1.2"
|
|
249
249
|
source = { editable = "../checkpoint" }
|
|
250
250
|
dependencies = [
|
|
251
251
|
{ name = "langchain-core" },
|
|
@@ -276,7 +276,7 @@ dev = [
|
|
|
276
276
|
|
|
277
277
|
[[package]]
|
|
278
278
|
name = "langgraph-checkpoint-postgres"
|
|
279
|
-
version = "2.0.
|
|
279
|
+
version = "2.0.25"
|
|
280
280
|
source = { editable = "." }
|
|
281
281
|
dependencies = [
|
|
282
282
|
{ name = "langgraph-checkpoint" },
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/conftest.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langgraph_checkpoint_postgres-2.0.24 → langgraph_checkpoint_postgres-2.0.25}/tests/test_store.py
RENAMED
|
File without changes
|