Import report items as json#548
Draft
dcansys wants to merge 3 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a JSON import path for serverless ADR report items, backed by shared Pydantic schemas for validating item payloads.
Changes:
- Adds shared JSON schema models for report items and top-level import payloads.
- Adds a serverless importer that loads JSON, creates a default layout template, and saves text/table/image/file/scene/tree items.
- Adds normalization helpers for JSON-style tags and table/tree conversion.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/ansys/dynamicreporting/core/utils/json_importer_models.py |
Defines Pydantic models for supported JSON report item payloads. |
src/ansys/dynamicreporting/core/serverless/json_importer.py |
Implements serverless import logic for validated JSON report items. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #548 +/- ##
==========================================
+ Coverage 82.33% 82.63% +0.29%
==========================================
Files 32 34 +2
Lines 8705 8918 +213
Branches 1585 1616 +31
==========================================
+ Hits 7167 7369 +202
- Misses 1054 1059 +5
- Partials 484 490 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
28a50b0 to
7ee078b
Compare
358ecd0 to
9b0a2e4
Compare
2270a46 to
f0e2147
Compare
f0e2147 to
22aae75
Compare
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.
This is implementation of reading, converting and inserting report items through the JSON format.
Items JSON import will load a JSON file, create a default template, and save all report items to ADR.
JSON Schema is in the documentation.
PoC: https://github.com/ansys-internal/adr_mechanical/tree/poc/import-report-items-as-json
Note: more enhanced default template with basic ToC and sections will come in the next iterations.
[Converting To Draft]: After having backlog refinement, it is decided to refactor the PR and come up with one 'BaseModel' pydantic based to replace the other two existing validation models, so it is not only json based. It will be revised again toward the end of the summer.