mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-23 08:02:23 +02:00
Fix filtering on ns
This commit is contained in:
@@ -260,7 +260,8 @@ class BasePostgresSaver(BaseCheckpointSaver):
|
||||
if config:
|
||||
wheres.append("thread_id = %s ")
|
||||
param_values.append(config["configurable"]["thread_id"])
|
||||
if checkpoint_ns := config["configurable"].get("checkpoint_ns"):
|
||||
checkpoint_ns = config["configurable"].get("checkpoint_ns")
|
||||
if checkpoint_ns is not None:
|
||||
wheres.append("checkpoint_ns = %s")
|
||||
param_values.append(checkpoint_ns)
|
||||
|
||||
|
||||
@@ -70,7 +70,8 @@ def search_where(
|
||||
if config is not None:
|
||||
wheres.append("thread_id = ?")
|
||||
param_values.append(config["configurable"]["thread_id"])
|
||||
if checkpoint_ns := config["configurable"].get("checkpoint_ns"):
|
||||
checkpoint_ns = config["configurable"].get("checkpoint_ns")
|
||||
if checkpoint_ns is not None:
|
||||
wheres.append("checkpoint_ns = ?")
|
||||
param_values.append(checkpoint_ns)
|
||||
|
||||
|
||||
@@ -210,7 +210,10 @@ class MemorySaver(
|
||||
config_checkpoint_id = get_checkpoint_id(config) if config else None
|
||||
for thread_id in thread_ids:
|
||||
for checkpoint_ns in self.storage[thread_id].keys():
|
||||
if config_checkpoint_ns and checkpoint_ns != config_checkpoint_ns:
|
||||
if (
|
||||
config_checkpoint_ns is not None
|
||||
and checkpoint_ns != config_checkpoint_ns
|
||||
):
|
||||
continue
|
||||
|
||||
for checkpoint_id, (
|
||||
|
||||
Reference in New Issue
Block a user