Skip to content

Commit

Permalink
add a date formatter to hydra parser to suppress warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
phobson authored and austinorr committed Jun 20, 2023
1 parent 6f099bb commit 1be39b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions cloudside/hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def parse_file(filepath):
"header": None,
"parse_dates": ["Date"],
"na_values": ["-"],
"date_format": "%d-%b-%Y",
}

with Path(filepath).open("r") as fr:
Expand Down
9 changes: 6 additions & 3 deletions cloudside/tests/test_hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from io import StringIO
from textwrap import dedent
import tempfile
import warnings

import pandas

Expand Down Expand Up @@ -98,9 +99,11 @@ def expected_hydra():


def test_parse_file(expected_hydra):
filepath = Path(get_test_file("sample_hydra.txt"))
result = hydra.parse_file(filepath)
pdtest.assert_frame_equal(expected_hydra, result)
with warnings.catch_warnings():
warnings.simplefilter("error")
filepath = Path(get_test_file("sample_hydra.txt"))
result = hydra.parse_file(filepath)
pdtest.assert_frame_equal(expected_hydra, result)


@mock.patch("requests.get")
Expand Down

0 comments on commit 1be39b1

Please sign in to comment.