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

Define ParseError as a dataclass #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Define ParseError as a dataclass #153

wants to merge 2 commits into from

Conversation

pgiraud
Copy link
Member

@pgiraud pgiraud commented Nov 27, 2024

Fixes #152

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.60%. Comparing base (5c45afe) to head (6da3a65).

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 Sentry.
📢 Have feedback on the report? Share it here.

pgtoolkit/errors.py Outdated Show resolved Hide resolved
Copy link
Member

@dlax dlax left a comment

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