Skip to content

feat: iris_validate_embedded_sql — check SQL compatibility in embedded Python context #39

@isc-tdyar

Description

@isc-tdyar

Problem

A SQL query can succeed via Atelier REST (iris_query) but fail when executed inside an embedded Python method. There's no tool to predict this before wiring up code, leading to hard-to-diagnose runtime failures deep in production code.

Proposed Tool: iris_validate_embedded_sql

iris_validate_embedded_sql("SELECT node_id FROM Graph_KG.nodes")

Returns:

{
  "sql": "SELECT node_id FROM Graph_KG.nodes",
  "works_external": true,
  "works_embedded": false,
  "reason": "Column resolution on class-projected table triggers ddtab bug in build 161",
  "workaround": "Use iris.sql.exec() with %NOINDEX hint, or query the backing global directly"
}

Implementation Notes

  • Run the query in both contexts (external via Atelier REST, embedded via execute_via_generator)
  • Compare results / errors
  • Cross-reference with iris_build_constraints (see related issue) for known build-specific issues
  • Could be a test mode of iris_query rather than a separate tool: iris_query(query, validate_embedded=true)

Value

Saves hours of debugging when queries mysteriously fail only in embedded context. Especially valuable for IRIS 2026.x where embedded Python SQL behavior changed significantly between builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions