Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

fix: use TIMESTAMP_SUB for TimstampSub operation #40

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

hwhitney456
Copy link
Contributor

Incorrect SQL expression was specified for TimestampSub.

Incorrect SQL expression was specified for TimestampSub.
@@ -419,7 +419,7 @@ def _formatter(translator, expr):
'TIMESTAMP_ADD', {'h', 'm', 's', 'ms', 'us'}
),
ops.TimestampSub: _timestamp_op(
'TIMESTAMP_DIFF', {'h', 'm', 's', 'ms', 'us'}
'TIMESTAMP_SUB', {'h', 'm', 's', 'ms', 'us'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that this is the correct function for TimestampSub

https://github.com/ibis-project/ibis/blob/3f9c6f7be5e547117f897df7e10cc519ffb831f4/ibis/expr/operations.py#L2820-L2827

It appears there is a TimestampDiff operator as well, so we might as well add support for that while we're here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or actually, I can do that in a follow-up PR

@tswast tswast changed the title Update compiler.py fix: use TIMESTAMP_SUB for TimstampSub operation Apr 26, 2021
@tswast tswast added the run-ci Code has been reviewed and is deemed safe to run label Apr 26, 2021
@tswast tswast merged commit 4c5cb57 into ibis-project:master Apr 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
run-ci Code has been reviewed and is deemed safe to run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants