Skip to content

Commit

Permalink
Fixed the usage of timedelta where months or years were used as the i…
Browse files Browse the repository at this point in the history
…nterval.
  • Loading branch information
twheys committed Oct 18, 2018
1 parent bd9f274 commit 0934c09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fireant/slicer/queries/special_cases.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import timedelta

import pandas as pd
from dateutil.relativedelta import relativedelta

from fireant.slicer.dimensions import DatetimeDimension
from fireant.slicer.filters import RangeFilter
Expand Down Expand Up @@ -50,7 +49,7 @@ def adjust_daterange_filter_for_rolling_window(dimensions, operations, filters):
args = {dim0.interval + 's': max_rolling_period} \
if 'quarter' != dim0.interval \
else {'months': max_rolling_period * 3}
filter_.definition.start.value -= timedelta(**args)
filter_.definition.start.value -= relativedelta(**args)

return filters

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ pandas==0.22.0
pypika==0.15.7
toposort==1.5
typing==3.6.2
python-dateutil==2.7.3

mock

0 comments on commit 0934c09

Please sign in to comment.