Skip to content

Replace ast.dump in error messages - #889

Merged
mristin merged 1 commit into
mainfrom
mristin/Replace-ast.dump
Nov 14, 2026
Merged

mristin merged 1 commit into
mainfrom
mristin/Replace-ast.dump

Conversation

@mristin

@mristin mristin commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

The output of ast.dump changes between Python versions (e.g., Python 3.13 omits ctx=Load()), which broke the recorded error messages when we moved from Python 3.12 to 3.14.

We introduce ast_dump.dump which renders only the top level of a node as source code, and describes its children briefly, e.g., f(<call to self.g>, *z, w=1) or <|-operator> | None. We keep ast.dump for the in-process structural comparisons in the parse rules, as nothing is recorded there.

The output of ``ast.dump`` changes between Python versions (*e.g.*,
Python 3.13 omits ``ctx=Load()``), which broke the recorded error
messages when we moved from Python 3.12 to 3.14.

We introduce ``ast_dump.dump`` which renders only the top level of
a node as source code, and describes its children briefly, *e.g.*,
``f(<call to self.g>, *z, w=1)`` or ``<|-operator> | None``. We keep
``ast.dump`` for the in-process structural comparisons in the parse
rules, as nothing is recorded there.
@mristin
mristin force-pushed the mristin/Replace-ast.dump branch from acf7cc5 to 337c256 Compare November 14, 2026 22:25
@mristin
mristin merged commit fedd830 into main Nov 14, 2026
5 checks passed
@mristin
mristin deleted the mristin/Replace-ast.dump branch November 14, 2026 22:37
@mristin

mristin commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@empwilli FYI

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 43648031260

Coverage decreased (-0.06%) to 90.289%

Details

  • Coverage decreased (-0.06%) from the base build.
  • Patch coverage: 41 uncovered changes across 1 file (57 of 98 lines covered, 58.16%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
aas_core_codegen/ast_dump.py 92 51 55.43%
Total (5 files) 98 57 58.16%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 52201
Covered Lines: 47132
Line Coverage: 90.29%
Coverage Strength: 2.71 hits per line

💛 - Coveralls

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.

2 participants