Skip to content

Add option for ExportCSVConfig to target txn outputs#262

Merged
davidwzhao merged 7 commits into
mainfrom
dz-export-output-2
Jun 24, 2026
Merged

Add option for ExportCSVConfig to target txn outputs#262
davidwzhao merged 7 commits into
mainfrom
dz-export-output-2

Conversation

@davidwzhao

@davidwzhao davidwzhao commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This PR adds a new option transaction_output_name to ExportCSVConfig. This option is used to specify that a CSV export result should be returned by the engine as part of transaction results, rather than written to a client-controlled path.

davidwzhao and others added 5 commits June 23, 2026 11:36
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
builtin.tuple is registered as variadic (arity -1), so make_builtin
gives it an empty param list and the generic type-variable matching
can't resolve the return type T. Add a special case that infers
TupleType directly from the argument types, matching what _infer_type
already does in the parser.

Without this, IfElse nodes wrapping tuple constructs were typed as
interface{} in Go, causing a compile error when the function's declared
return type is []interface{}.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…xportCSVConfig

ExportCSVColumns had no custom == so structural comparison fell back to identity,
breaking ExportCSVSource comparisons. Add equality for ExportCSVColumns first,
then ExportCSVSource, then wire csv_source, csv_config, and the new
transaction_output_name field into ExportCSVConfig ==, hash, and isequal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@comnik comnik self-requested a review June 23, 2026 08:59
Comment thread meta/src/meta/target.py
Comment on lines +348 to +350
# builtin.tuple is variadic; infer TupleType from the argument types directly.
if isinstance(self.func, Builtin) and self.func.name == "tuple":
return TupleType(tuple(a.target_type() for a in self.args))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this needed? 🤔

@davidwzhao davidwzhao Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new grammar rule i think is the first use of tuples as return values in the grammar, and this exposed a bug in the parser generator. I'm not super sure on the details, but Claude found the problem and this was its fix

@davidwzhao davidwzhao marked this pull request as ready for review June 24, 2026 06:33
@davidwzhao davidwzhao merged commit f7b00a3 into main Jun 24, 2026
5 checks passed
@davidwzhao davidwzhao deleted the dz-export-output-2 branch June 24, 2026 08:14
@hbarthels hbarthels mentioned this pull request Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants