Skip to content

Commit 412d523

Browse files
JiT: protos update to enable execution in CLI (#2107)
- Enhance error coercion in common/errors/errors.ts - Sync protos/execution.proto and protos/jit.proto with new fields
1 parent bdcb1e4 commit 412d523

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

common/errors/errors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export function coerceAsError<T extends Error | any>(errorLike: T): T extends Er
1515
if ((errorLike as any) instanceof Error) {
1616
return errorLike as any;
1717
}
18-
const error = (errorLike as any) as Error;
18+
const error = errorLike as any;
1919
// Otherwise, attempt to reconstruct an error class from the object.
20-
const message = error.message ? String(error.message) : String(errorLike);
21-
const coercedError = new Error(message);
20+
const message = error.message || error.error || (typeof errorLike === "string" ? errorLike : JSON.stringify(errorLike));
21+
const coercedError = new Error(String(message));
2222
if (error.stack) {
2323
coercedError.stack = error.stack;
2424
}

protos/execution.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package dataform;
44

55
import "protos/core.proto";
66
import "protos/db_adapter.proto";
7+
import "google/protobuf/struct.proto";
78

89
option go_package = "github.com/dataform-co/dataform/protos/dataform";
910

@@ -43,6 +44,8 @@ message ExecutionAction {
4344

4445
ActionDescriptor action_descriptor = 9;
4546

47+
string jit_code = 12;
48+
4649
reserved 1, 3, 7;
4750
}
4851

@@ -59,6 +62,7 @@ message ExecutionGraph {
5962
repeated Target declaration_targets = 5;
6063

6164
repeated ExecutionAction actions = 3;
65+
google.protobuf.Struct jit_data = 7;
6266
}
6367

6468
message Timing {

0 commit comments

Comments
 (0)