Skip to content
Snippets Groups Projects
Unverified Commit 9924a783 authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

MLv2: Fix `:relative-datetime` schema (#29769)

parent c410f8ab
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,8 @@
(:require
[metabase.lib.schema.expression :as expression]
[metabase.lib.schema.mbql-clause :as mbql-clause]
[metabase.lib.schema.temporal-bucketing :as temporal-bucketing]))
[metabase.lib.schema.temporal-bucketing :as temporal-bucketing]
[metabase.util.malli.registry :as mr]))
(mbql-clause/define-tuple-mbql-clause :interval
:int
......@@ -51,9 +52,14 @@
#_:datetimestr [:schema [:ref ::expression/string]]
#_:unit [:ref ::temporal-bucketing/unit.date-time.interval])
(mr/def ::relative-datetime.amount
[:or
[:= :current]
:int])
(mbql-clause/define-tuple-mbql-clause :relative-datetime :- :type/DateTime
#_:datetimestr [:schema [:ref ::expression/string]]
#_:unit [:ref ::temporal-bucketing/unit.date-time.interval])
#_n [:ref ::relative-datetime.amount]
#_unit [:ref ::temporal-bucketing/unit.date-time.interval])
(mbql-clause/define-tuple-mbql-clause :time :- :type/TimeWithTZ
#_:timestr [:schema [:ref ::expression/string]]
......
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