Skip to content
Snippets Groups Projects
Commit dfa55039 authored by Callum Herries's avatar Callum Herries
Browse files

Fix FE type inferencer

parent 63e67d1b
No related branches found
No related tags found
No related merge requests found
......@@ -1264,6 +1264,10 @@ export class ExpressionDimension extends Dimension {
base_type = "type/Boolean";
break;
case MONOTYPE.DateTime:
base_type = "type/DateTime";
break;
// fallback
default:
base_type = "type/Float";
......
......@@ -6,6 +6,7 @@ export const MONOTYPE = {
Number: "number",
String: "string",
Boolean: "boolean",
DateTime: "datetime",
};
export function infer(mbql, env) {
......@@ -34,6 +35,8 @@ export function infer(mbql, env) {
}
switch (op) {
case "now":
return MONOTYPE.DateTime;
case "case":
return infer(mbql[1][0][1], env);
case "coalesce":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment