Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Emit warning when both city and city_id arguments are provided #125

Merged
merged 1 commit into from
Apr 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: Emit warning when both city and city_air arguments are provided
  • Loading branch information
lahdjirayhan committed Apr 23, 2022
commit 248a0063503a83d8b25dff659d8ad747cb84fc11
6 changes: 6 additions & 0 deletions src/ozone/ozone.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,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