Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge the Report._files/_chunks #553

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Merge the Report._files/_chunks #553

wants to merge 6 commits into from

Conversation

Swatinem
Copy link
Contributor

@Swatinem Swatinem commented Mar 4, 2025

Instead of maintaining two separate fields, this merges the previous _files which was a dict from filename to totals, and the _chunks which was either a fully parsed ReportFile, or just a shallow list of lines.

Maintaining only a single structure for the list of files makes a ton of internals of the Report simpler.

It also solves the problem of file_totals getting out of sync with the ReportFile.totals.


Builds on top of #552 and #554, and might still need a bit of more work.

@Swatinem Swatinem self-assigned this Mar 4, 2025
Swatinem added 4 commits March 4, 2025 15:01
This merges the previous `to_database` and `to_archive` methods into one, which serializes a Report to the `report_json` and `chunks` pairs, and can optionally return a `totals` dict as well.
@Swatinem Swatinem force-pushed the swatinem/one-file branch from 38b2cc6 to 4974cef Compare March 5, 2025 09:05
Instead of maintaining two separate fields, this merges the previous `_files` which was a dict from filename to `totals`, and the `_chunks` which was either a fully parsed `ReportFile`, or just a shallow `list` of lines.

Maintaining only a single structure for the list of files makes a ton of internals of the `Report` simpler.

It also solves the problem of `file_totals` getting out of sync with the `ReportFile.totals`.
@Swatinem Swatinem force-pushed the swatinem/one-file branch from 4974cef to f6d9418 Compare March 5, 2025 10:21
Base automatically changed from swatinem/mv-reportfile to main March 5, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant