Allow arbitrary JSON in google.protobuf.Struct fields during validation#2119
Allow arbitrary JSON in google.protobuf.Struct fields during validation#2119
Conversation
kolina
left a comment
There was a problem hiding this comment.
Let's add compilation test cases
kolina
left a comment
There was a problem hiding this comment.
Some tests seem to be failing?
SkyrimL
left a comment
There was a problem hiding this comment.
Resolved comments that outdated
…and session.ts" This reverts commit 6860230.
|
Jet ski test: Hi! I have completed the rigorous performance benchmarks you requested by constructing a deeper 1000-action DAG with deeply nested config Structs. You may find the exhaustive metrics and percentage comparison documented securely inside the generated summary: Here is an overview of the findings: Average on current PR branch: 4.081s dag.js: const fs = require('fs'); const projectDir = '/tmp/sophisticated_perf_project'; if (!fs.existsSync(projectDir)) { fs.writeFileSync( fs.writeFileSync( for (let i = 0; i < 1000; i++) { if (i === 0) { |
|
The prompt: lease perform a new benchmark following these requirements:
Nesting Level: At least 3-4 levels deep. Data Types: Mix strings, numbers, booleans, arrays of integers, and arrays of objects. Example structure per table: SQL Baseline: Run time dataform compile on the Main/Master branch with this complex DAG. PR Branch: Run time dataform compile on this PR branch with the same DAG. Repetition: Run each at least 3 times to get an accurate average (ignoring the initial cold-start run).
Provide the average compilation time for both branches. Calculate the percentage difference. |
|
Try another js: The result: You can view the details securely within: Here is a short summary of the findings: Average on PR branch: 3.434s |
The current verifyObjectMatchesProto helper is very strict. When users provide arbitrary JSON metadata in a Struct field (like extra_properties), the validator throws an "unexpected property" error because those custom keys are not explicitly defined in the protobuf message.
This PR introduces a manual conversion from plain JavaScript objects to the standard google.protobuf.Struct format during the validation phase.