Skip to content

Commit 1bf7414

Browse files
Revert "wip on key sep"
This reverts commit 7d48f33.
1 parent 7d48f33 commit 1bf7414

File tree

6 files changed

+14
-25
lines changed

6 files changed

+14
-25
lines changed

langgraph/checkpoint/redis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def get_tuple(self, config: RunnableConfig) -> Optional[CheckpointTuple]:
303303

304304
# Fetch pending_sends from parent checkpoint
305305
pending_sends = []
306-
if "parent_checkpoint_id" in doc:
306+
if doc["parent_checkpoint_id"]:
307307
pending_sends = self._load_pending_sends(
308308
thread_id=thread_id,
309309
checkpoint_ns=checkpoint_ns,

langgraph/checkpoint/redis/ashallow.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
{
3939
"index": {
4040
"name": "checkpoints",
41-
"prefix": CHECKPOINT_PREFIX,
42-
"key_separator": REDIS_KEY_SEPARATOR,
41+
"prefix": CHECKPOINT_PREFIX + REDIS_KEY_SEPARATOR,
4342
"storage_type": "json",
4443
},
4544
"fields": [
@@ -52,8 +51,7 @@
5251
{
5352
"index": {
5453
"name": "checkpoints_blobs",
55-
"prefix": CHECKPOINT_BLOB_PREFIX,
56-
"key_separator": REDIS_KEY_SEPARATOR,
54+
"prefix": CHECKPOINT_BLOB_PREFIX + REDIS_KEY_SEPARATOR,
5755
"storage_type": "json",
5856
},
5957
"fields": [
@@ -66,8 +64,7 @@
6664
{
6765
"index": {
6866
"name": "checkpoint_writes",
69-
"prefix": CHECKPOINT_WRITE_PREFIX,
70-
"key_separator": REDIS_KEY_SEPARATOR,
67+
"prefix": CHECKPOINT_WRITE_PREFIX + REDIS_KEY_SEPARATOR,
7168
"storage_type": "json",
7269
},
7370
"fields": [

langgraph/checkpoint/redis/base.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
{
3232
"index": {
3333
"name": "checkpoints",
34-
"prefix": CHECKPOINT_PREFIX,
35-
"key_separator": REDIS_KEY_SEPARATOR,
34+
"prefix": CHECKPOINT_PREFIX + REDIS_KEY_SEPARATOR,
3635
"storage_type": "json",
3736
},
3837
"fields": [
@@ -47,8 +46,7 @@
4746
{
4847
"index": {
4948
"name": "checkpoints_blobs",
50-
"prefix": CHECKPOINT_BLOB_PREFIX,
51-
"key_separator": REDIS_KEY_SEPARATOR,
49+
"prefix": CHECKPOINT_BLOB_PREFIX + REDIS_KEY_SEPARATOR,
5250
"storage_type": "json",
5351
},
5452
"fields": [
@@ -62,8 +60,7 @@
6260
{
6361
"index": {
6462
"name": "checkpoint_writes",
65-
"prefix": CHECKPOINT_WRITE_PREFIX,
66-
"key_separator": REDIS_KEY_SEPARATOR,
63+
"prefix": CHECKPOINT_WRITE_PREFIX + REDIS_KEY_SEPARATOR,
6764
"storage_type": "json",
6865
},
6966
"fields": [

langgraph/checkpoint/redis/shallow.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
{
3232
"index": {
3333
"name": "checkpoints",
34-
"prefix": CHECKPOINT_PREFIX,
35-
"key_separator": REDIS_KEY_SEPARATOR,
34+
"prefix": CHECKPOINT_PREFIX + REDIS_KEY_SEPARATOR,
3635
"storage_type": "json",
3736
},
3837
"fields": [
@@ -45,8 +44,7 @@
4544
{
4645
"index": {
4746
"name": "checkpoints_blobs",
48-
"prefix": CHECKPOINT_BLOB_PREFIX,
49-
"key_separator": REDIS_KEY_SEPARATOR,
47+
"prefix": CHECKPOINT_BLOB_PREFIX + REDIS_KEY_SEPARATOR,
5048
"storage_type": "json",
5149
},
5250
"fields": [
@@ -59,8 +57,7 @@
5957
{
6058
"index": {
6159
"name": "checkpoint_writes",
62-
"prefix": CHECKPOINT_WRITE_PREFIX,
63-
"key_separator": REDIS_KEY_SEPARATOR,
60+
"prefix": CHECKPOINT_WRITE_PREFIX + REDIS_KEY_SEPARATOR,
6461
"storage_type": "json",
6562
},
6663
"fields": [

langgraph/store/redis/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from redisvl.query import FilterQuery, VectorQuery
2626
from redisvl.redis.connection import RedisConnectionFactory
2727
from redisvl.utils.token_escaper import TokenEscaper
28-
from redisvl.utils.utils import create_ulid
28+
from ulid import ULID
2929

3030
from langgraph.store.redis.aio import AsyncRedisStore
3131
from langgraph.store.redis.base import (
@@ -223,7 +223,7 @@ def _batch_put_ops(
223223
# Generate IDs for PUT operations
224224
for _, op in put_ops:
225225
if op.value is not None:
226-
generated_doc_id = create_ulid()
226+
generated_doc_id = str(ULID())
227227
namespace = _namespace_to_text(op.namespace)
228228
doc_ids[(namespace, op.key)] = generated_doc_id
229229

langgraph/store/redis/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
{
4545
"index": {
4646
"name": "store",
47-
"prefix": STORE_PREFIX,
48-
"key_separator": REDIS_KEY_SEPARATOR,
47+
"prefix": STORE_PREFIX + REDIS_KEY_SEPARATOR,
4948
"storage_type": "json",
5049
},
5150
"fields": [
@@ -58,8 +57,7 @@
5857
{
5958
"index": {
6059
"name": "store_vectors",
61-
"prefix": STORE_VECTOR_PREFIX,
62-
"key_separator": REDIS_KEY_SEPARATOR,
60+
"prefix": STORE_VECTOR_PREFIX + REDIS_KEY_SEPARATOR,
6361
"storage_type": "json",
6462
},
6563
"fields": [

0 commit comments

Comments
 (0)