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):
9090 def show_func (x ):
9191 return x [: x .find (":" )]
9292
93+ unique_keys = {k for s in results for k in s ["additional_metadata" ]}
9394 for entry in results :
9495 series = pd .DataFrame (entry ["data" ])[["dates" , "values" ]].set_index ("dates" )
9596 head = entry ["additional_metadata" ]
96-
97+ for k in unique_keys :
98+ if k not in head :
99+ head [k ] = "-1:None"
97100 if head != "" : # this additional metadata is not blank
98101 series .columns = pd .MultiIndex .from_tuples (
99102 [[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):
1212
1313
1414class 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+
1531 def test_infer_start_end_from_symbols (self ):
1632 df = web .DataReader (
1733 (
You can’t perform that action at this time.
0 commit comments