Files
langflow/src
Tarcio e136bc7e70 chore(triggers): silence SQLModel exec-warning on legitimate execute() calls
SQLModel's AsyncSession raises a DeprecationWarning on every
session.execute() call urging the caller to use session.exec() —
but exec is typed for SELECT-returning statements only. Our five
execute() call-sites all pass non-SELECT statements that exec
explicitly does not accept (text() raw SQL or update() constructs),
so the warning is informational and cannot be acted on by changing
the code.

In the worker's hot path the warning fires on every claim cycle
(every 0.5–5s depending on backoff), flooding the log. The crud
helpers fire it once at boot (reset_stalled_in_progress) and once
per flow save (cancel_queued_jobs_for_components). None are
actionable, all are noisy.

NEW services/triggers/_sqlmodel_compat.py
  suppress_sqlmodel_exec_warning() — a narrow context manager that
  filters DeprecationWarning ONLY from sqlmodel.ext.asyncio.session.
  Any other DeprecationWarning still surfaces. The module is
  underscore-prefixed to signal it's an internal compatibility shim,
  not part of the public surface.

Five call-sites wrapped:
  worker.py (3): _claim_one's Postgres FOR UPDATE SKIP LOCKED select,
                its follow-up UPDATE, and the SQLite optimistic
                UPDATE...RETURNING.
  crud.py (2):  cancel_queued_jobs_for_components and
                reset_stalled_in_progress, both update() constructs.

Verified by running the full trigger test suite with
-W 'error::DeprecationWarning:sqlmodel.ext.asyncio.session' — all
tests still pass, confirming the suppression actually engages at
runtime (without it, the warnings-as-errors filter would fail every
test that hits the worker path). Ruff clean on all three files.
2026-05-21 15:09:04 -03:00
..