Repository navigation
Commit dbb5c7f
authored
Fail Neo4jOperator argument mistakes at Dag parse time (#70508)
Whether `cypher` or `sql` was passed is a property of how the Dag was
written, not of the rendered value, and the constructor is the only place
that can read it: under render_template_as_native_obj a supplied field can
render to None, so the same check in execute reports an argument the author
did provide as missing. Checking at construction also surfaces the mistake
as a Dag import error instead of once per task instance.
The execute guard stays: a passed field can still render to None and the
hook needs a query string.
related: #705031 parent abd837a commit dbb5c7f
2 files changed
Lines changed: 15 additions & 9 deletions
File tree
- providers/neo4j
- src/airflow/providers/neo4j/operators
- tests/unit/neo4j/operators
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
73 | | - | |
74 | | - | |
75 | 77 | | |
76 | 78 | | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | | - | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
0 commit comments