Skip to content

Commit

Permalink
update import, ASFSession uses warn again
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed Aug 2, 2024
1 parent f2c5133 commit 8c4e8dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions asf_search/ASFSession.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from logging import warn
import platform
from typing import List, Union
import requests
Expand All @@ -6,7 +7,7 @@

from asf_search import ASF_LOGGER, __name__ as asf_name, __version__ as asf_version
from asf_search.exceptions import ASFAuthenticationError

from warnings import warn


class ASFSession(requests.Session):
Expand Down Expand Up @@ -88,7 +89,7 @@ def __init__(
self.cmr_host = INTERNAL.CMR_HOST

if cmr_host is not None:
ASF_LOGGER.warning(
warn(
'Use of `cmr_host` keyword with `ASFSession` is deprecated '
'for asf-search versions >= 7.0.9, '
'and may be removed in a future major release.'
Expand Down Expand Up @@ -140,7 +141,7 @@ def auth_with_creds(self, username: str, password: str):
token = self.cookies.get_dict().get('urs-access-token')

if token is None:
ASF_LOGGER.warning(
warn(
f'Provided asf_auth_host "{self.asf_auth_host}" returned no EDL token '
'during ASFSession validation. EDL Token expected in "urs-access-token" cookie, '
'required for hidden/restricted dataset access. '
Expand Down
2 changes: 1 addition & 1 deletion asf_search/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from .baseline_search import stack_from_id # noqa: F401
from .campaigns import campaigns # noqa: F401
from .search_count import search_count # noqa: F401
from .search_generator import search_generator # noqa: F401
from .search_generator import search_generator, preprocess_opts # noqa: F401

0 comments on commit 8c4e8dd

Please sign in to comment.