def test_interval_date_expr(table): c = table.j x = api.timedelta(days=1) expr = x + c assert isinstance(expr, ir.DateColumn) assert isinstance(expr.op(), ops.DateAdd) # test radd expr = c + x assert isinstance(expr, ir.DateColumn) assert isinstance(expr.op(), ops.DateAdd)
def test_interval_timestamp_expr(table): c = table.i x = api.timedelta(seconds=1) expr = x + c assert isinstance(expr, ir.TimestampColumn) assert isinstance(expr.op(), ops.TimestampAdd) # test radd expr = c + x assert isinstance(expr, ir.TimestampColumn) assert isinstance(expr.op(), ops.TimestampAdd)
def test_interval_time_expr(table): c = table.k x = api.timedelta(hours=1) expr = x + c assert isinstance(expr, ir.TimeColumn) assert isinstance(expr.op(), ops.TimeAdd) # test radd expr = c + x assert isinstance(expr, ir.TimeColumn) assert isinstance(expr.op(), ops.TimeAdd)