Skip to content

FIX: ParseException handling in pyparsing 3.2.0 - #584

Merged
richardotis merged 3 commits into
pycalphad:developfrom
richardotis:fix-string-parse-errors
Dec 16, 2024
Merged

richardotis merged 3 commits into
pycalphad:developfrom
richardotis:fix-string-parse-errors

Conversation

@richardotis

@richardotis richardotis commented Nov 30, 2024 •

Copy link
Copy Markdown
Collaborator

A recent change in pyparsing added caching to attributes on ParseException objects using the cached_property decorator. Those caches are not invalidated when the pstr and loc for the ParseException objects are modified (as we do, to provide more accurate line numbers, since #550 ).

The caches for these properties are stored as attributes on the instances with the same name as the property, so it is easy to clear the cache using obj.__dict__.pop('property_name', None). This is backwards-compatible since it's a no-op on previous versions of pyparsing, where only the property decorator is present. Details of how this works can be found in the answers to this StackOverflow question.

@richardotis richardotis changed the title FIX: String parse errors FIX: ParseException handling in pyparsing 3.2.0 Nov 30, 2024
@richardotis
richardotis requested a review from bocklund November 30, 2024 22:18
@codecov

codecov Bot commented Nov 30, 2024 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.99%. Comparing base (7bb7b77) to head (e034881).
⚠️ Report is 47 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #584   +/-   ##
========================================
  Coverage    91.99%   91.99%           
========================================
  Files           77       77           
  Lines        12271    12273    +2     
========================================
+ Hits         11289    11291    +2     
  Misses         982      982           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@richardotis
richardotis merged commit c67006a into pycalphad:develop Dec 16, 2024
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.

3 participants