Skip to content

Commit

Permalink
fix: '>' not supported between instances of 'datetime.date' and 'str'
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Apr 17, 2024
1 parent 07086be commit d8822c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions insights/insights/query_builders/sql_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ def get_directional_date_range(direction, unit, number_of_unit):
get_fiscal_year_ending(add_to_date(today, years=direction)),
]

dates = [getdate(date) if not isinstance(date, datetime.date) else date for date in dates]

if dates[0] > dates[1]:
dates.reverse()
return dates
Expand Down

0 comments on commit d8822c9

Please sign in to comment.