diff --git a/logprep/util/time.py b/logprep/util/time.py index 32a209289..f02190611 100644 --- a/logprep/util/time.py +++ b/logprep/util/time.py @@ -4,8 +4,6 @@ from typing import Union from zoneinfo import ZoneInfo -import ciso8601 - from logprep.abc.exceptions import LogprepException UTC = ZoneInfo("UTC") @@ -35,7 +33,7 @@ def from_string(cls, source: str, set_missing_utc: bool = True) -> datetime: datetime object """ try: - time_object = ciso8601.parse_datetime(source) # pylint: disable=c-extension-no-member + time_object = datetime.fromisoformat(source) # pylint: disable=c-extension-no-member if set_missing_utc: time_object = cls._set_utc_if_timezone_is_missing(time_object) return time_object diff --git a/pyproject.toml b/pyproject.toml index 5ece8ed2a..0f9fec7a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,6 @@ dependencies = [ "aiohttp>=3.9.2", # CVE-2024-23334 "attrs", "certifi>=2023.7.22", # CVE-2023-37920 - "ciso8601", # fastest iso8601 datetime parser. can be removed after dropping support for python < 3.11 "colorama", "confluent-kafka>2", "geoip2", diff --git a/tests/unit/processor/timestamp_differ/test_timestamp_differ.py b/tests/unit/processor/timestamp_differ/test_timestamp_differ.py index dd082562a..edb0bf6a8 100644 --- a/tests/unit/processor/timestamp_differ/test_timestamp_differ.py +++ b/tests/unit/processor/timestamp_differ/test_timestamp_differ.py @@ -343,7 +343,7 @@ "subfield": {"field2": "2022-12-05 12:00:00"}, "tags": ["_timestamp_differ_failure"], }, - r".*ProcessingWarning.*Invalid character while parsing", + r".*ProcessingWarning.*Invalid isoformat string: 'non-timestamp'", ), ( "diff between two timestamps with partial timestamp format match",