fix: mkdocs description + staged error handling in plot() (#56, #50)#57
Open
tschm wants to merge 2 commits into
Open
fix: mkdocs description + staged error handling in plot() (#56, #50)#57tschm wants to merge 2 commits into
tschm wants to merge 2 commits into
Conversation
…haskar#56, alihaskar#50) - mkdocs.yml: replace placeholder site_description with the real description from pyproject.toml (alihaskar#56) - interface.py: split the broad except in plot() so DataValidationError is reported with stage="validation" (fixable input) separately from server/runtime failures reported with stage="server" (alihaskar#50) - test_interface.py: assert the validation stage is reported Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves project metadata and makes the Python plot() API’s error reporting more actionable by distinguishing user-fixable input validation failures from server/runtime failures.
Changes:
- Replaces the MkDocs scaffold placeholder
site_descriptionwith the real project description (matchingpyproject.toml). - Splits
plot()error handling intoDataValidationErrorvs generic runtime errors and annotates error results with astage. - Updates the invalid-data plot test to assert
stage == "validation".
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
mkdocs.yml |
Replaces placeholder site_description with the real project description for published docs metadata. |
src/pycharting/api/interface.py |
Adds staged error handling to plot() by catching DataValidationError separately and returning stage in error results. |
tests/pycharting/api/test_interface.py |
Tightens the invalid-data test to verify validation errors are surfaced with stage: "validation". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Splitting the broad except in plot() left the generic (server/runtime) except branch unexercised once validation errors took their own branch, dropping interface.py coverage below 100%. Add a test that forces a ChartServer startup failure and asserts stage="server". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
Merged into #58The commits on this branch (
No conflicts on merge. #58 supersedes this PR — recommend closing this one in favour of #58 (or merging #57 first, then #58). 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses three quality issues.
#56 — Replace placeholder mkdocs
site_descriptionmkdocs.ymlcarried the scaffold placeholderAdd your description here.. Set it to the real description already present inpyproject.toml(single source of truth):#50 — Narrow broad
except Exceptioninplot()The
plot()body was wrapped in a single broadexcept Exception, collapsing input-validation failures and server/runtime failures into one generic error. Split into:except DataValidationError→{"status": "error", "stage": "validation", ...}— fixable by correcting input arrays.except Exception→{"status": "error", "stage": "server", ...}— server startup / browser / runtime failures.The
errorkey is preserved for backward compatibility.test_plot_with_invalid_datanow assertsstage == "validation".#54 — Failing
test_websocket_endpoint_addedThe test already carries the defensive
getattr(route, "path", None)guard and passes; closing that issue separately as already-fixed.Verification
Full suite: 94 passed, exit 0.
Closes #56
Closes #50
🤖 Generated with Claude Code