File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -90,10 +90,13 @@ def show_func(x):
90
90
def show_func (x ):
91
91
return x [: x .find (":" )]
92
92
93
+ unique_keys = {k for s in results for k in s ["additional_metadata" ]}
93
94
for entry in results :
94
95
series = pd .DataFrame (entry ["data" ])[["dates" , "values" ]].set_index ("dates" )
95
96
head = entry ["additional_metadata" ]
96
-
97
+ for k in unique_keys :
98
+ if k not in head :
99
+ head [k ] = "-1:None"
97
100
if head != "" : # this additional metadata is not blank
98
101
series .columns = pd .MultiIndex .from_tuples (
99
102
[[show_func (x ) for x in head .values ()]],
Original file line number Diff line number Diff line change @@ -12,6 +12,22 @@ def assert_equal(x, y):
12
12
13
13
14
14
class TestEcondb (object ):
15
+
16
+ def test_override_start_end (self ):
17
+ df = web .DataReader (
18
+ '&' .join ([
19
+ 'dataset=RBI_BULLETIN' ,
20
+ 'v=TIME' ,
21
+ 'h=Indicator' ,
22
+ 'from=2022-01-01' ,
23
+ 'to=2022-07-01'
24
+ ]),
25
+ 'econdb' ,
26
+ start = '2020-01-01' ,
27
+ end = '2022-01-01'
28
+ )
29
+ assert isinstance (df .index , pd .DatetimeIndex )
30
+
15
31
def test_infer_start_end_from_symbols (self ):
16
32
df = web .DataReader (
17
33
(
You can’t perform that action at this time.
0 commit comments