Skip to content

Commit

Permalink
Exclude deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhoey committed Aug 28, 2024
1 parent adccff5 commit 91063e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/pywaterinfo/waterinfo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pkg_resources

import datetime
import logging
import pandas as pd
Expand Down Expand Up @@ -30,7 +28,6 @@
VMM_AUTH = "http://download.waterinfo.be/kiwis-auth/token"
HIC_BASE = "https://hicws.vlaanderen.be/KiWIS/KiWIS"
HIC_AUTH = "https://hicwsauth.vlaanderen.be/auth"
DATA_PATH = pkg_resources.resource_filename(__name__, "./data")

# Custom hard-coded fix for the decoding issue #1 of given returnfields
DECODE_ERRORS = ["AV Quality Code Color", "RV Quality Code Color"]
Expand Down
8 changes: 3 additions & 5 deletions tests/test_waterinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import pandas as pd
import pytz
import sys
from pandas.api import types
from pandas.api.types import is_datetime64tz_dtype

from pywaterinfo import HIC_BASE, VMM_BASE, Waterinfo
from pywaterinfo.waterinfo import WaterinfoException
Expand Down Expand Up @@ -217,14 +215,14 @@ def test_utc_default_return(self, connection, df_timeseries): # noqa
"""Check that the returned dates are UTC aware and according to the user
input in UTC
"""
assert is_datetime64tz_dtype(df_timeseries["Timestamp"])
assert isinstance(df_timeseries["Timestamp"].dtype, pd.DatetimeTZDtype)
assert df_timeseries.loc[0, "Timestamp"] == pd.to_datetime(
"2019-05-01T00:00:00.000Z"
)
assert df_timeseries["Timestamp"].min() == pd.to_datetime(
"2019-05-01T00:00:00.000Z"
)
assert types.is_datetime64tz_dtype(pd.to_datetime(df_timeseries["Timestamp"]))
assert isinstance(df_timeseries["Timestamp"].dtype, pd.DatetimeTZDtype)
assert (
pd.to_datetime(df_timeseries.loc[0, "Timestamp"]).tz
== datetime.timezone.utc
Expand Down Expand Up @@ -477,7 +475,7 @@ def test_datetime_conversion(self, connection, request):
df = connection.get_timeseries_values(
ts_id="60992042,60968042", start="20190501 14:05", end="20190501 14:10"
)
assert pd.core.dtypes.common.is_datetime64tz_dtype(df["Timestamp"])
assert isinstance(df["Timestamp"].dtype, pd.DatetimeTZDtype)


@pytest.mark.parametrize("connection", ["vmm_connection", "vmm_cached_connection"])
Expand Down

0 comments on commit 91063e2

Please sign in to comment.