Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
deeleeramone committed May 15, 2024
1 parent 09aebf8 commit b37955c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ async def aextract_data(
yield_curve_type=query.yield_curve_type,
)
YIELD_CURVE = IDS["SERIES_IDS"]
MATURITIES = IDS["MATURITIES"]

maturities = list(MATURITIES.keys())

Expand All @@ -103,8 +102,10 @@ async def get_one(maturity, use_cache):
await session.close()
else:
response = await amake_request(url=url)
if not response:
raise RuntimeError("Error: No data was returned.")
if isinstance(response, List):
for item in response:
for item in response: # pylint: disable=E0606
d = {
"date": item.get("PERIOD"),
"maturity": maturity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ async def aextract_data( # pylint: disable=R0914.R0912,R0915
response = await helpers.amake_request( # type: ignore
url, timeout=20, **kwargs
)

data = response.get("results")
if not response.get("results"):
if not response:
raise RuntimeError("Error: No data was returned.")
data = response.get("results") # pylint: disable=E0606
if not data:
raise EmptyDataError("The response was returned empty.")
return data

Expand Down

0 comments on commit b37955c

Please sign in to comment.