diff --git a/CHANGELOG.md b/CHANGELOG.md index b3fa10d2..b56cac13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,11 +26,12 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). --> ------ -## [v7.0.10](https://github.com/asfadmin/Discovery-asf_search/compare/v7.0.9...v7.0.10) +## [v7.1.0](https://github.com/asfadmin/Discovery-asf_search/compare/v7.0.9...v7.1.0) ### Added - Improved logging in `ASFSession` authentication methods ### Changed +- Uses `ciso8601` module for parsing dates from CMR response, significant performance improvement post-query - `ASFSession` now allows for authorized user access to hidden/restricted CMR datasets via `auth_with_creds()` or `auth_with_cookiejar()` authentication methods (previously only supported via `auth_with_token()` method) - `ASFSession.auth_with_token()` now authenticates directly against EDL endpoint diff --git a/asf_search/CMR/translate.py b/asf_search/CMR/translate.py index 1c57de58..d564d9c7 100644 --- a/asf_search/CMR/translate.py +++ b/asf_search/CMR/translate.py @@ -9,7 +9,7 @@ from shapely.geometry.base import BaseGeometry from .field_map import field_map from .datasets import collections_per_platform -import dateparser +import ciso8601 import logging @@ -157,8 +157,11 @@ def try_parse_date(value: str) -> Optional[str]: if value is None: return None - date = dateparser.parse(value) - + try: + date = ciso8601.parse_datetime(value) + except ValueError: + return None + if date is None: return value diff --git a/setup.py b/setup.py index d88008cf..69e29546 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,8 @@ "importlib_metadata", "numpy", "dateparser", - "tenacity == 8.2.2" + "tenacity == 8.2.2", + "ciso8601" ] test_requirements = [ diff --git a/tests/ASFSearchResults/test_ASFSearchResults.py b/tests/ASFSearchResults/test_ASFSearchResults.py index 68e55ec2..7f80a124 100644 --- a/tests/ASFSearchResults/test_ASFSearchResults.py +++ b/tests/ASFSearchResults/test_ASFSearchResults.py @@ -1,6 +1,5 @@ from typing import Dict, List -import dateparser import asf_search as asf from asf_search import ASFSearchResults import defusedxml.ElementTree as DefusedETree