Skip to content

Commit

Permalink
chore: add more debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
zachstence committed Aug 2, 2024
1 parent bb7ed05 commit 4620ae9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ export const QueryResultSchema = z
// inconsistent array (e.g. [{}, 1]), it will not detect the
// invalid row.
rows: QueryResultArraySchema.or(QueryResultGeneratorSchema),
columnTypes: z.array(
z.object({
name: z.string(),
evidenceType: z.enum(['boolean', 'number', 'string', 'date']),
typeFidelity: z.union([z.literal('precise'), z.literal('inferred')])
columnTypes: z
.any()
.refine((arg) => {
console.log('QueryResultSchema.columnTypes', { arg });
return arg;
})
),
.pipe(
z.array(
z.object({
name: z.string(),
evidenceType: z.enum(['boolean', 'number', 'string', 'date']),
typeFidelity: z.union([z.literal('precise'), z.literal('inferred')])
})
)
),
expectedRowCount: z.number().optional()
})
.refine(
Expand Down
20 changes: 14 additions & 6 deletions packages/lib/sdk/src/plugins/datasources/schemas/results.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ const QueryResultArraySchema = z.any().refine(
const QueryResultGeneratorSchema = z.function();

const QueryResultMetaSchema = z.object({
columnTypes: z.array(
z.object({
name: z.string(),
evidenceType: z.enum(['boolean', 'number', 'string', 'date']),
typeFidelity: z.union([z.literal('precise'), z.literal('inferred')])
columnTypes: z
.any()
.refine((arg) => {
console.log('QueryResultMetaSchema.columnTypes', { arg });
return arg;
})
),
.pipe(
z.array(
z.object({
name: z.string(),
evidenceType: z.enum(['boolean', 'number', 'string', 'date']),
typeFidelity: z.union([z.literal('precise'), z.literal('inferred')])
})
)
),
expectedRowCount: z.number().optional()
});

Expand Down

0 comments on commit 4620ae9

Please sign in to comment.