Show the deprecated Neo4jOperator sql query in Rendered Templates#70373
Merged
Conversation
shahar1
force-pushed
the
fix-neo4j-sql-rendered-templates
branch
from
July 24, 2026 09:23
96e35fb to
916cca5
Compare
The sql parameter is a deprecated alias for cypher. It used to be folded into cypher in the constructor, so it was rendered by the normal template-field machinery and the resolved query appeared in the Rendered Templates view. It is now kept as a separate attribute that is not a template field and is rendered by an ad-hoc render_template() call inside execute(), so the view shows an empty cypher while a different query runs, and the rendering bypasses the standard pipeline. Declaring sql as a template field lets the framework render it as it does every other field. The deprecation warning moves to execute() because a constructor only ever sees the un-rendered Jinja expression of a template field.
shahar1
force-pushed
the
fix-neo4j-sql-rendered-templates
branch
from
July 24, 2026 09:26
916cca5 to
b29fa87
Compare
eladkal
approved these changes
Jul 24, 2026
This was referenced Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI Summary
Follow-up to #70348.
sqlis a deprecated alias forcypher. It used to be folded intocypherin the constructor, so it went through the normal template-field machinery: the resolved query appeared in the Rendered Templates view (with thesqlrenderer) andop.cypherheld it.It is now kept as a separate attribute that is not declared a template field, and is rendered by an ad-hoc
self.render_template(self.sql, context)insideexecute(). So for anyone still onsql=:cypher: Nonewhile a different query actually runs — the executed query is no longer visible anywhere but the task log.template_fields_renderers).Declaring
sqla template field lets the framework render it like every other field and drops the manual call.The deprecation warning moves to
execute()as a consequence: reading a template field in__init__is exactly whatvalidate_operators_initnow forbids, and the constructor would only see the un-rendered expression anyway. The warning still fires once per task run, and bothValueErrors are unchanged.related: #70296
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines