You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
8
8
## [Development]
9
9
<!-- Do Not Erase This Section - Used for tracking unreleased changes -->
10
10
11
+
### Fixed
12
+
-**GFQL:**`Chain` now validates on construction (matching docs) and rejects invalid hops immediately; pass `validate=False` to defer validation when assembling advanced flows (fixes #860).
13
+
14
+
### Docs
15
+
-**GFQL validation:** Clarified `Chain` constructor validation defaults, `validate=False` defer option, validation phases, and guidance for large/nested ASTs to reduce redundant validation (issue #860).
Operations are automatically validated during construction:
108
+
Chains validate on construction by default. Nodes, edges, predicates, refs, calls, and remote graphs are validated when a parent `Chain`/`Let` validates them or when you call `.validate()` directly. Schema validation is a separate, data-aware pass.
109
109
110
110
```python
111
111
from graphistry.compute.chain import Chain
@@ -118,6 +118,28 @@ chain = Chain([
118
118
])
119
119
```
120
120
121
+
For advanced flows (large/nested ASTs or staged assembly), you can defer structural validation and run it once after assembly:
122
+
123
+
```python
124
+
# Defer validation while building
125
+
chain = Chain([
126
+
n({'type': 'person'}),
127
+
e_forward({'hops': -1})
128
+
], validate=False) # No validation yet
129
+
130
+
# Later, validate once (or let g.gfql validate it)
131
+
chain.validate() # Raises GFQLTypeError: hops must be positive
132
+
```
133
+
134
+
Use deferred validation to avoid re-validating nested `Chain`/`Let` wrappers during assembly; keep the defaults for typical workflows so mistakes surface immediately.
135
+
136
+
### Validation Phases
137
+
138
+
-**Constructor defaults:**`Chain([...])` and `Let(...)` validate immediately; pass `validate=False` to defer.
139
+
-**Parent-driven checks:** AST operations (`Node`, `Edge`, predicates, `Ref`, `Call`, `RemoteGraph`) validate when their parent validates, or via explicit `.validate()`.
140
+
-**JSON defaults:**`to_json` / `from_json` default to `validate=True`, which runs structural validation during serialization/deserialization.
141
+
-**Schema validation:** Use `validate_chain_schema(g, chain)` or `g.gfql(..., validate_schema=True)` to verify column/type compatibility before execution.
142
+
121
143
### Schema Validation
122
144
123
145
You have two options for validating queries against your data schema:
@@ -409,4 +431,4 @@ result = g.gfql(let({
409
431
## See Also
410
432
411
433
- {ref}`gfql-spec-language` - Core language specification
412
-
-[GFQL Quick Reference](../quick.rst) - Python API examples
434
+
-[GFQL Quick Reference](../quick.rst) - Python API examples
0 commit comments