Skip to content

Define ParseError as a dataclass#153

Open
pgiraud wants to merge 2 commits into
masterfrom
errors_dataclass
Open

Define ParseError as a dataclass#153
pgiraud wants to merge 2 commits into
masterfrom
errors_dataclass

Conversation

@pgiraud

@pgiraud pgiraud commented Nov 27, 2024

Copy link
Copy Markdown
Member

Fixes #152

@codecov-commenter

codecov-commenter commented Nov 27, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.60%. Comparing base (5c45afe) to head (6da3a65).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #153      +/-   ##
==========================================
- Coverage   97.61%   97.60%   -0.01%     
==========================================
  Files          10       10              
  Lines        1214     1213       -1     
==========================================
- Hits         1185     1184       -1     
  Misses         29       29              

☔ View full report in Codecov by Harness.
📢 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.

Comment thread pgtoolkit/errors.py Outdated

@dlax dlax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure defining exception classes as dataclass is a good idea; I've never seen this pattern. In particular, I am worried about the fact that the super-class constructor is no longer called, so that the args attribute, part of BaseException API, is empty. This might not be a very big deal in practice depending on what users do with the exception value, but this does not seem very clean.

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.

Define errors.ParseError as a dataclass

4 participants