Repository navigation
fix: preserve nested report template paths - #590
Merged
fdosani merged 2 commits intoOct 25, 2026
Merged
Conversation
fdosani
force-pushed
the
fix/nested-report-templates
branch
from
October 18, 2026 14:01
7b0bece to
5944321
Compare
fdosani
force-pushed
the
fix/nested-report-templates
branch
from
October 22, 2026 11:39
5944321 to
4503a2d
Compare
fdosani
enabled auto-merge (squash)
October 22, 2026 11:40
auto-merge was automatically disabled
October 23, 2026 14:31
Pull request was closed
Member
|
@Thanatos9404 can you redo the CLA please. Something is wonky with it. |
A folder of partials is often named after the template that includes
them, such as summary/ next to summary.j2. The exact name matched the
folder because only existence was checked, so render("summary") passed
the folder to Jinja and failed instead of falling back to summary.j2.
Match only files. A name that matches nothing but a folder now raises
the documented FileNotFoundError.
fdosani
force-pushed
the
fix/nested-report-templates
branch
from
October 25, 2026 09:34
4503a2d to
abe1d8b
Compare
Contributor
Author
|
Thanks for rebasing it. The CLA check now reports signed on the new head, so it should be clear once the Spark jobs finish. |
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.
Nested relative report templates can fail to load or silently select a same-named template at the root.
_resolve_template_path()returns native backslashes on Windows, which Jinja rejects, and its extension fallbacks return only the basename, dropping the subdirectory. A folder named after a template, such assummary/next tosummary.j2, also matched the exact-name check, sorender("summary")failed instead of loadingsummary.j2.Return forward-slash relative names for Jinja, retain the full relative path when adding or removing
.j2, and match only files. A name that matches nothing but a folder now raises the documentedFileNotFoundError. Relative names still resolve against datacompy's bundledtemplatesdirectory, and exact-filename precedence and absolute-path handling remain the same. Includes continue to resolve from that template root, and parent traversal remains rejected by Jinja.For example,
render("custom/summary/report", value=42)now loadsdatacompy/templates/custom/summary/report.j2, even whendatacompy/templates/report.j2also exists. Nested templates with their exact extension also work on Windows.Validation on Windows, Python 3.12:
PYTHONUTF8=1: 752 passed, 18 skipped, no failures.datacompy/base.pyanddatacompy/report.py, including imported modules, reports the same 164 diagnostic messages as clean main.No dependencies or public API changes are introduced. This is independent of the HTML charset and Unicode table-width fixes in #588 and #589.