Skip to content

Commit

Permalink
Update and run pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhoey committed Aug 16, 2024
1 parent f56e407 commit a9f06ed
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ exclude: '^docs/conf.py'

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.8.0
hooks:
- id: black
language_version: python3.9

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand All @@ -24,7 +23,7 @@ repos:
args: ['--fix=no']

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
args: ['--max-line-length=88'] # default of Black
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""

from setuptools import setup

if __name__ == "__main__":
Expand Down
3 changes: 2 additions & 1 deletion src/pywaterinfo/waterinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@ def get_timeseries_values(
if "Timestamp" in df.columns:
# round trip via UTC to handle mixed time series
df["Timestamp"] = pd.to_datetime(
df["Timestamp"], utc=True).dt.tz_convert(timezone)
df["Timestamp"], utc=True
).dt.tz_convert(timezone)
time_series.append(df)

return pd.concat(time_series)
Expand Down
13 changes: 7 additions & 6 deletions tests/test_waterinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,13 @@ def test_timezone_mixed_timezone(self, connection, request):
See also https://github.com/fluves/pywaterinfo/issues/67
"""
connection = request.getfixturevalue(connection)
df = connection.get_timeseries_values('69928042',
start='2013-03-21 00:00:00',
end='2013-04-01 23:00:00',
timezone='CET',
returnfields="Timestamp,Value"
)
df = connection.get_timeseries_values(
"69928042",
start="2013-03-21 00:00:00",
end="2013-04-01 23:00:00",
timezone="CET",
returnfields="Timestamp,Value",
)
assert isinstance(df["Timestamp"].dtype, pd.DatetimeTZDtype)
assert df["Timestamp"].dt.tz == pytz.timezone("CET")

Expand Down

0 comments on commit a9f06ed

Please sign in to comment.