refactor(bigframes): update SQLGlot compiler to process AI func params better#16757
refactor(bigframes): update SQLGlot compiler to process AI func params better#16757
Conversation
…nds of param names
There was a problem hiding this comment.
Code Review
This pull request refactors the _construct_named_args function to dynamically iterate over operation arguments instead of using hardcoded field checks. The feedback suggests using the local value variable when processing categories for better type safety, ensuring consistent use of double quotes for string literals, and improving the generic argument handler to correctly handle non-string types or raise an error for unsupported ones.
|
Test failure is unrelated. |
| args.append( | ||
| sge.Kwarg(this=field, expression=sge.Literal.string(value.upper())) | ||
| ) | ||
| else: |
There was a problem hiding this comment.
Do we want to check for the field is "output_schema" explicitly? This would allow us to decide how to handle unknown fields - either failing fast, ignoring them, or similarly to "output_schema" - which is better for forward compatibility.
There was a problem hiding this comment.
I think we should be good without checking the "output_schema", as the intention of this PR is to make the compiler able to handle all kinds of fields without explicit mentions.
No description provided.