Skip to content

Commit

Permalink
Don't show timezone warnings for UTC
Browse files Browse the repository at this point in the history
UTC is the default and should not show any warnings as we can fallback to timezone.UTC.

Fixes #140
  • Loading branch information
yunzheng committed Sep 24, 2024
1 parent f5d1a70 commit 2c6c241
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flow/record/fieldtypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def flow_record_tz(*, default_tz: str = "UTC") -> Optional[ZoneInfo | UTC]:
try:
return ZoneInfo(tz)
except ZoneInfoNotFoundError as exc:
warnings.warn(f"{exc!r}, falling back to timezone.utc")
if tz != "UTC":
warnings.warn(f"{exc!r}, falling back to timezone.utc")
return UTC


Expand Down

0 comments on commit 2c6c241

Please sign in to comment.