Skip to content

Commit

Permalink
lint and fix package
Browse files Browse the repository at this point in the history
  • Loading branch information
aysim319 committed Sep 13, 2024
1 parent 8a308c4 commit b4039c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _delphi_utils_python/delphi_utils/validator/datafetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ def get_geo_signal_combos(data_source, api_key):

response = Epidata.covidcast_meta()

# pylint: disable=R1720
if response["result"] != 1:
# Something failed in the API and we did not get real metadata
raise RuntimeError("Error when fetching metadata from the API", response["message"])

# pylint: disable=I0021
else:
meta = pd.DataFrame.from_dict(response["epidata"])
# note: this will fail for signals with weekly data, but currently not supported for validation
Expand Down Expand Up @@ -187,17 +189,19 @@ def fetch_api_reference(data_source, start_date, end_date, geo_type, signal_type
# Something failed in the API and we did not get real signal data
raise RuntimeError("Error when fetching signal data from the API", response["message"])

# pylint: disable=E1124
if response["message"] not in {"success", "no results"}:
# pylint: disable=E1123
warnings.warn(
"Problem obtaining data",
# pylint: disable=E0602
RuntimeWarning,
message=response["message"],
data_source=data_source,
signal=signal,
time_value=params["time_values"],
geo_type=geo_type,
)
logger.info(f"Trying calling covidcast again")
response = Epidata.covidcast(
data_source,
signal_type,
Expand Down
1 change: 1 addition & 0 deletions sir_complainsalot/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

required = [
"darker[isort]~=2.1.1",
"delphi-epidata",
"delphi-utils",
"pandas",
"pylint==2.8.3",
Expand Down

0 comments on commit b4039c5

Please sign in to comment.