wren-langchain: session properties are not forwarded, same gap as #2638
Summary
WrenToolkit.query() / dry_plan() / dry_run() in sdk/wren-langchain never
accept or forward session properties to the engine. wren.engine.WrenEngine
already threads properties through its whole planning path, so any project
with row-level access control (RLAC) enabled cannot be queried through this
SDK at all: planning fails with a missing-session-property error, and there
is no parameter to supply one.
This is the same defect reported in #2638 for wren-pydantic; the two
toolkits share the same method signatures and the gap is identical in both.
Root cause
core/wren/src/wren/engine.py
dry_plan(self, sql, properties=None)
query(self, sql, limit=None, properties=None) calls self.dry_plan(sql, properties)
dry_run(self, sql, properties=None) same shape
sdk/wren-langchain/src/wren_langchain/_toolkit.py
query(self, sql, limit=None) calls engine.query(sql, limit=limit), no properties
dry_plan(self, sql) calls engine.dry_plan(sql), same gap
dry_run(self, sql) same
Repro
toolkit = WrenToolkit.from_project("./my_project")
toolkit.query("SELECT * FROM orders") # no `properties` kwarg available
With an RLAC rule requiring session_user_id, this always fails with a
missing-session-property planning error, and there is no way to pass one
through the toolkit.
Fix
Opening a PR now that adds the properties kwarg to all three methods and
forwards it to the engine, mirroring the fix shape already proposed for
wren-pydantic in #2684.
wren-langchain: session properties are not forwarded, same gap as #2638
Summary
WrenToolkit.query()/dry_plan()/dry_run()insdk/wren-langchainneveraccept or forward session properties to the engine.
wren.engine.WrenEnginealready threads
propertiesthrough its whole planning path, so any projectwith row-level access control (RLAC) enabled cannot be queried through this
SDK at all: planning fails with a missing-session-property error, and there
is no parameter to supply one.
This is the same defect reported in #2638 for
wren-pydantic; the twotoolkits share the same method signatures and the gap is identical in both.
Root cause
core/wren/src/wren/engine.pydry_plan(self, sql, properties=None)query(self, sql, limit=None, properties=None)callsself.dry_plan(sql, properties)dry_run(self, sql, properties=None)same shapesdk/wren-langchain/src/wren_langchain/_toolkit.pyquery(self, sql, limit=None)callsengine.query(sql, limit=limit), nopropertiesdry_plan(self, sql)callsengine.dry_plan(sql), same gapdry_run(self, sql)sameRepro
With an RLAC rule requiring
session_user_id, this always fails with amissing-session-property planning error, and there is no way to pass one
through the toolkit.
Fix
Opening a PR now that adds the
propertieskwarg to all three methods andforwards it to the engine, mirroring the fix shape already proposed for
wren-pydanticin #2684.