| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
The awareness check misses valid naive cases, and the new constraint leaves public documentation and examples inaccurate.
Review effort: Balanced
Findings: 3
Adds timezone validation and inverted-window warnings to reporting requests.
Changes:
| File | Description |
|---|---|
| src/frequenz/client/reporting/_client.py | Validates request timestamps. |
| src/frequenz/client/reporting/cli/__main__.py | Validates CLI timestamps and warns on inverted ranges. |
| tests/test_client_reporting.py | Tests client-side validation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was a problem hiding this comment.
The validator still accepts naive datetimes whose timezone returns no UTC offset, causing an unintended downstream exception.
2 open issuesReview effort: Balanced
Sorry, something went wrong.
A naive datetime is ambiguous: the wire encoding assumes UTC while datetime.timestamp() assumes local time, so the same value would denote different instants. Reject it at the public request boundary rather than silently pick one meaning. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com>
There was a problem hiding this comment.
The documented CLI timestamps still lack offsets and are rejected by the new validation.
2 open issuesReview effort: Balanced
Sorry, something went wrong.
A naive datetime is ambiguous: the wire encoding assumes UTC while datetime.timestamp() assumes local time. Reject it at the argparse boundary so the CLI fails with a clear message instead of a ValueError. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com>
An inverted window is a legal but empty range, so the request still runs; at the CLI it is almost always a typo, and the silent empty output gives no hint why. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com>
Fixes CI problem. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com>
AC_ACTIVE_POWER and AC_REACTIVE_POWER are not members of Metric. The CLI validates --metrics against the enum, so the documented command errored out, and the Python examples referenced attributes that do not exist. Use the actual names AC_POWER_ACTIVE and AC_POWER_REACTIVE. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com>
There was a problem hiding this comment.
Static review found no blocking issues, and the compatibility change is documented; tests were not run.
2 open issuesReview effort: Balanced
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
| if args.start and args.end and args.end < args.start: | ||
| print( | ||
| "warning: --end is before --start; no data will be returned", | ||
| file=sys.stderr, | ||
| ) |
There was a problem hiding this comment.
I wonder if it doesn't make more sense to just reject it? Do you want to allow it for any specific reason?
Sorry, something went wrong.
There was a problem hiding this comment.
Agreed, I think throwing an error makes sense here so that it can break scripts that manage to create invalid input parameters etc
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Guards the reporting request time range against two easy mistakes: ambiguous naive datetimes and an inverted window.
client now raises rather than silently pick one meaning.