Skip to content

Commit

Permalink
Merge pull request #125 from lahdjirayhan/warn-both-historic
Browse files Browse the repository at this point in the history
fix: Emit warning when both city and city_id arguments are provided
  • Loading branch information
Milind220 committed Apr 23, 2022
2 parents c060779 + 248a006 commit 017cb00
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ozone/ozone.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,12 @@ def get_historical_data(
"you can use get_city_station_options method first to "
"identify the correct city ID."
)
else:
if city is not None:
warnings.warn(
"Both arguments city and city_id were supplied. "
"Only city_id will be used. city argument will be ignored."
)

df = get_data_from_id(city_id)
return self._format_output(data_format, df)
Expand Down

0 comments on commit 017cb00

Please sign in to comment.