Skip to content

Commit

Permalink
Ensure Gauge ID is a String (fixes #42)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasdennis authored Dec 4, 2023
1 parent 2acb3f2 commit f5b9c6b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime, timedelta
import logging
from typing import List
import pytz

Expand All @@ -18,6 +19,9 @@ def __init__(self, gauge_id: str) -> None:
Args:
gauge_id (str): A string of the USGS gauge id number.
"""
if not isinstance(gauge_id, str):
logging.warning(f"gauge_id passed to LevelProviderNWIS should be a string but it was not, casting to string: {gauge_id}")
gauge_id = str(gauge_id)
self.gauge_id = gauge_id
self.reference_timestamp: Optional[datetime] = None

Expand Down

0 comments on commit f5b9c6b

Please sign in to comment.