Skip to content

Commit

Permalink
fix: stuck-two-day should not consider no data anomaly
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemandl committed Oct 27, 2024
1 parent 3e4bad3 commit 3c95c24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions py_src/stuck_two_day/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,7 @@ def run(event, _context):
if err.response.status_code == 400:
try: # have to try decoding json
if err.response.json()["error"] == "No data":
payload = MeterAnomaly(
point_name,
ALGORITHM,
now().isoformat(),
"No data for the period.",
0,
MIN_DATAPOINTS_LENGTH,
start_time.isoformat(),
end_time.isoformat(),
)
payload = {}
except ValueError:
pass
return payload
2 changes: 1 addition & 1 deletion py_src/stuck_two_day/stuck_two_day_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_handle400(mocker):
)
event = {"body": {"pointName": "foo"}}
result = run(event, None)
assert "No data" in result["description"]
assert not result


def test_barf(mocker):
Expand Down

0 comments on commit 3c95c24

Please sign in to comment.