Skip to content

Commit

Permalink
Removed date/timestamp diff. It should use diff between extracted dat…
Browse files Browse the repository at this point in the history
…e part.
  • Loading branch information
xmnlab committed Apr 20, 2018
1 parent 228a8f5 commit ca6e240
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions ibis/mapd/operations.py
Expand Up @@ -779,26 +779,6 @@ class Conv_4326_900913_Y(ops.UnaryOp):
))


class TimestampDiff(ops.ValueOp):
left = ops.Arg(rlz.timestamp)
right = ops.Arg(rlz.timestamp)
unit = ops.Arg(rlz.isin(_timestamp_units))
output_type = rlz.shape_like('left', ops.dt.int32)

def __init__(self, left, right, unit):
super(TimestampDiff, self).__init__(left, right, unit)


class DateDiff(ops.ValueOp):
left = ops.Arg(rlz.date)
right = ops.Arg(rlz.date)
unit = ops.Arg(rlz.isin(_timestamp_units))
output_type = rlz.shape_like('left', ops.dt.int32)

def __init__(self, left, right, unit):
super(DateDiff, self).__init__(left, right, unit)


class TimestampExtract(ops.TimestampUnaryOp):
unit = ops.Arg(rlz.isin(_timestamp_units))
output_type = rlz.shape_like('arg', ops.dt.int32)
Expand Down Expand Up @@ -966,12 +946,8 @@ class ByteLength(ops.StringLength):

ops.DateAdd: _timestamp_op('TIMESTAMPADD'),
ops.DateSub: _timestamp_op('TIMESTAMPADD', '-'),
# ops.DateDiff: _timestamp_op('DATEDIFF'),
TimestampDiff: _timestamp_diff('TIMESTAMPDIFF', timestamp_code),
ops.TimestampAdd: _timestamp_op('TIMESTAMPADD'),
ops.TimestampSub: _timestamp_op('TIMESTAMPADD', '-'),
DateDiff: _timestamp_diff('TIMESTAMPDIFF', timestamp_code),
# ops.TimestampDiff: _timestamp_op('TIMESTAMPDIFF', diff=True),
}


Expand Down

0 comments on commit ca6e240

Please sign in to comment.