Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/compat.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ These are the cases where the proof holds Python to something narrower than "ide
- **Interned queries.** Upstream's builder hands back the query it built before when a step repeats one,
keyed so that some values JavaScript's types rule out share a key: a `flip` of `'yes'` with `true`, any
`orderBy` direction but `'asc'` with `'desc'`. In one process, such a value can come back as whichever
was built first. Python builds what it is given. The harness gives each program a fresh schema, which
was built first. Python interns as well, but by exact keys, so it builds what it is given. The harness gives each program a fresh schema, which
upstream interns by, so that no comparison depends on the programs before it.
- **A mutator returning `null`.** Upstream records a mutator's return value as result data unless it is
`undefined`, so a TypeScript mutator can return `null` as data. Python has only `None`, which the port
Expand Down
5 changes: 4 additions & 1 deletion src/zero_server/protocol/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import functools
from collections.abc import Callable, Sequence
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, ClassVar, Literal, Protocol

from zero_server.protocol.wire import dump_json, json_model, parse_wire
Expand Down Expand Up @@ -192,6 +192,9 @@ class CorrelatedSubquery:
hidden: bool | None = None
subquery: AST
system: System | None = None
# The builder query `subquery` is the AST of, kept alive with it: the builder interns a query by
# the identity of its subqueries' ASTs, so they must outlive the query keyed by them.
source: Any = field(default=None, repr=False, compare=False)

def to_json(self) -> dict[str, Any]:
out: dict[str, Any] = {"correlation": self.correlation.to_json()}
Expand Down
Loading
Loading