Skip to content

Commit

Permalink
NOTAM code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
devdupont committed Jun 6, 2023
1 parent b623d48 commit 4b22c81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions avwx_api/handle/notam.py
Expand Up @@ -3,7 +3,7 @@
"""

import re
from datetime import date, datetime
from datetime import date, datetime, timezone

import avwx
from avwx.exceptions import exception_intercept
Expand All @@ -20,12 +20,12 @@
TAG_PATTERN = re.compile(r"<[^>]*>")


def timestamp_from_notam_date(text: str | None) -> Timestamp | str | None:
def timestamp_from_notam_date(text: str | None) -> Timestamp | None:
"""Convert FAA NOTAM dt format"""
if not text:
return None
if text.startswith("PERM"):
return "PERM"
return Timestamp(text, datetime(2100, 1, 1, tzinfo=timezone.utc))
if len(text) < 13:
return None
try:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
@@ -1,6 +1,6 @@
git+https://github.com/avwx-rest/avwx-api-core@a7fc3c9cba08361ebc0bb0bc8c9e711d310146af

avwx-engine[all]==1.8.12
avwx-engine[all]==1.8.13
hypercorn~=0.14
python-dotenv~=1.0
rollbar>=0.16
Expand Down

0 comments on commit 4b22c81

Please sign in to comment.