File tree 4 files changed +8
-5
lines changed
4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
from .pyngeso import NgEso
2
2
3
- __version__ = '0.1.0 '
3
+ __version__ = '0.1.1 '
Original file line number Diff line number Diff line change 1
1
import logging
2
2
from typing import Optional , List
3
- from datetime import datetime
3
+ from datetime import datetime , timedelta
4
4
import json
5
5
import re
6
6
@@ -91,6 +91,9 @@ def construct_date_range(
91
91
raise ValueError ("At least one of {start_date,end_date} should be provided" )
92
92
if all (dates_provided ):
93
93
self .validate_date_range (start_date , end_date )
94
+ # add 1 day to end_date as casting as timestamp rounds it down to midnight
95
+ if end_date :
96
+ end_date = datetime .strptime (end_date , "%Y-%m-%d" ) + timedelta (days = 1 )
94
97
95
98
date_range_map = {
96
99
(True , False ): f"where \" { date_col } \" > '{ start_date } '::timestamp" ,
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " pyngeso"
3
- version = " 0.1.0 "
3
+ version = " 0.1.1 "
4
4
description = " Simple python wrapper for the National Grid ESO Portal"
5
5
authors = [" atsangarides <andreas_tsangarides@hotmail.com>" ]
6
6
license = " MIT"
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def test_day_ahead_historic_forecast():
20
20
assert isinstance (records , list )
21
21
assert len (records ) > 0
22
22
unique_target_dates = set ([record .get ("TARGETDATE" ) for record in records ])
23
- assert len (unique_target_dates ) == 1
23
+ assert len (unique_target_dates ) == 2
24
24
25
25
26
26
@pytest .mark .vcr
@@ -52,4 +52,4 @@ def test_2day_ahead_historic_forecast():
52
52
assert isinstance (records , list )
53
53
assert len (records ) > 0
54
54
unique_target_dates = set ([record .get ("TARGETDATE" ) for record in records ])
55
- assert len (unique_target_dates ) == 1
55
+ assert len (unique_target_dates ) == 2
You can’t perform that action at this time.
0 commit comments