Skip to content

Commit 555e42f

Browse files
black reformatting
1 parent 4550a05 commit 555e42f

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
lines changed

pandas_datareader/econdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def read(self):
8383
if self._show == "labels":
8484

8585
def show_func(x):
86-
return x[x.find(":") + 1:]
86+
return x[x.find(":") + 1 :]
8787

8888
elif self._show == "codes":
8989

pandas_datareader/tests/test_econdb.py

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ def test_infer_start_end_from_symbols(self):
2626
assert df.index[0].year == 2010
2727
assert df.index[-1].year == 2018
2828

29-
tickers = [f'{sec}{geo}' for sec in ['RGDP', 'CPI', 'URATE']
30-
for geo in ['US', 'UK', 'ES', 'AR']]
29+
tickers = [
30+
f"{sec}{geo}"
31+
for sec in ["RGDP", "CPI", "URATE"]
32+
for geo in ["US", "UK", "ES", "AR"]
33+
]
3134

3235
@pytest.mark.parametrize("ticker", tickers)
3336
def test_fetch_single_ticker_series(self, ticker):
3437
df = web.DataReader(
35-
f"ticker={ticker}", "econdb",
38+
f"ticker={ticker}",
39+
"econdb",
3640
start=pd.Timestamp("2010-01-01"),
3741
end=pd.Timestamp("2013-01-27"),
3842
)
@@ -52,35 +56,39 @@ def test_single_nonticker_series(self):
5256

5357
def test_filtered_dataset(self):
5458
df = web.DataReader(
55-
'&'.join([
56-
'dataset=PRC_HICP_MIDX',
57-
'v=Geopolitical entity (reporting)',
58-
'h=TIME',
59-
'from=2022-03-01',
60-
'to=2022-09-01',
61-
'COICOP=[CP00]',
62-
'FREQ=[M]',
63-
'GEO=[ES,AT,CZ,IT,CH]',
64-
'UNIT=[I15]'
65-
]),
66-
'econdb'
59+
"&".join(
60+
[
61+
"dataset=PRC_HICP_MIDX",
62+
"v=Geopolitical entity (reporting)",
63+
"h=TIME",
64+
"from=2022-03-01",
65+
"to=2022-09-01",
66+
"COICOP=[CP00]",
67+
"FREQ=[M]",
68+
"GEO=[ES,AT,CZ,IT,CH]",
69+
"UNIT=[I15]",
70+
]
71+
),
72+
"econdb",
6773
)
6874
assert df.shape[1] == 5
6975
assert isinstance(df.index, pd.DatetimeIndex)
7076

7177
def test_australia_gdp(self):
7278
df = web.DataReader(
73-
'&'.join([
74-
'dataset=ABS_GDP',
75-
'4=[7]',
76-
'6=[11]',
77-
'16=[1267]',
78-
'v=TIME',
79-
'h=Indicator',
80-
'from=2019-10-01',
81-
'to=2022-06-01',
82-
'GEO=[13]'
83-
]),
84-
'econdb'
79+
"&".join(
80+
[
81+
"dataset=ABS_GDP",
82+
"4=[7]",
83+
"6=[11]",
84+
"16=[1267]",
85+
"v=TIME",
86+
"h=Indicator",
87+
"from=2019-10-01",
88+
"to=2022-06-01",
89+
"GEO=[13]",
90+
]
91+
),
92+
"econdb",
8593
)
8694
assert_equal(df.squeeze().loc["2020-10-01"], 508603)

0 commit comments

Comments
 (0)