File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
bigframes/core/compile/sqlglot/expressions Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change 2626register_binary_op = scalar_compiler .scalar_op_compiler .register_binary_op
2727
2828
29- def _calculate_resample_first (y : TypedExpr , origin : str ) -> sge .Expression :
30- if origin == "epoch" :
31- return sge .convert (0 )
32- elif origin == "start_day" :
33- return sge .func (
34- "UNIX_MICROS" ,
35- sge .Cast (
36- this = sge .Cast (
37- this = y .expr , to = sge .DataType (this = sge .DataType .Type .DATE )
38- ),
39- to = sge .DataType (this = sge .DataType .Type .TIMESTAMPTZ ),
40- ),
41- )
42- elif origin == "start" :
43- return sge .func (
44- "UNIX_MICROS" ,
45- sge .Cast (this = y .expr , to = sge .DataType (this = sge .DataType .Type .TIMESTAMPTZ )),
46- )
47- else :
48- raise ValueError (f"Origin { origin } not supported" )
49-
50-
5129@register_binary_op (ops .DatetimeToIntegerLabelOp , pass_op = True )
5230def datetime_to_integer_label_op (
5331 x : TypedExpr , y : TypedExpr , op : ops .DatetimeToIntegerLabelOp
You can’t perform that action at this time.
0 commit comments