Skip to content

Commit

Permalink
addressed some future/deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Sep 15, 2023
1 parent 66ddc0a commit ebbd488
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions omnipath/_core/downloader/_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def maybe_download(
try:
res = self._download(req)
except RequestException:
logging.warn(f"Failed to download from `{domain}`.")
logging.warn(traceback.format_exc())
logging.warning(f"Failed to download from `{domain}`.")
logging.warning(traceback.format_exc())
continue
res = callback(res)
if cache:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_fallback_urls(self, requests_mock, csv_data: bytes):
downloader = Downloader(opt)
res = downloader.maybe_download(query, callback=pd.read_csv)

assert requests_mock.called_once
assert requests_mock.called
np.testing.assert_array_equal(res.index, csv_df.index)
np.testing.assert_array_equal(res.columns, csv_df.columns)
np.testing.assert_array_equal(res.values, csv_df.values)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest

from pandas.api.types import is_object_dtype, is_categorical_dtype
from pandas.api.types import is_object_dtype
import numpy as np
import pandas as pd

Expand Down Expand Up @@ -144,7 +144,7 @@ def test_no_dtype_conversion(self, cache_backup, requests_mock, tsv_data: bytes)
options.convert_dtypes = True

res = Enzsub.get()
assert is_categorical_dtype(res["modification"])
assert isinstance(res["modification"].dtype, pd.CategoricalDtype)
assert requests_mock.called_once


Expand Down

0 comments on commit ebbd488

Please sign in to comment.