Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.
Prev Previous commit
Next Next commit
fix fields for ResultNode
  • Loading branch information
TrevorBergeron committed Apr 28, 2025
commit 79f022ea63f9cab42ccf9d3055d570d00451ba69
13 changes: 13 additions & 0 deletions bigframes/core/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,19 @@ def remap_refs(
order_by = self.order_by.remap_column_refs(mappings) if self.order_by else None
return dataclasses.replace(self, output_names=output_names, order_by=order_by) # type: ignore

@property
def fields(self) -> Sequence[Field]:
# Fields property here is for output schema, not to be consumed by a parent node.
input_fields_by_id = {field.id: field for field in self.child.fields}
return tuple(
Field(
identifiers.ColumnId(output),
input_fields_by_id[ref.id].dtype,
input_fields_by_id[ref.id].nullable,
)
for ref, output in self.output_cols
)

@property
def consumed_ids(self) -> COLUMN_SET:
out_refs = frozenset(ref.id for ref, _ in self.output_cols)
Expand Down