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

Fix dataclass issues for Python 3.11 #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rharish101
Copy link

@rharish101 rharish101 commented Mar 15, 2023

This PR adds Python 3.11 support.

Closes #88.

Description

Transformer doesn't work in Python 3.11, due to breaking changes in dataclasses (python/cpython#99401). Namely, the default values for dataclass fields must be hashable. In the Transformer codebase, MappingProxyType is used, which isn't hashable. This PR fixes those issues, by using default_factory to get around this issue.

Types of Changes

What types of changes does your code introduce? Keep the ones that apply:

  • Bug fix (non-breaking change which fixes an issue)

Review

Reviewers' checklist:

  • If this PR implements new flows or changes existing ones, are there
    good tests for these flows?
    If this PR rather removes flows, are the obsolete tests removed as well?
  • Is the documentation still up-to-date and exhaustive? This covers both
    technical (in source files) and functional (under docs/) documentation.
  • Is the changelog updated?
  • Does the new version number correspond to the actual changes from this PR?
    In doubt, refer to https://semver.org.

After this PR

Any follow-up action necessary?

Reference: python/cpython#99401

Signed-off-by: Harish Rajagopal <harish.rajagopals@gmail.com>
@rharish101 rharish101 requested a review from thilp as a code owner March 15, 2023 13:56
@zincr
Copy link

zincr bot commented Mar 15, 2023

🤖 zincr found 1 problem , 0 warnings

❌ Approvals
✅ Large Commits
✅ Specification
✅ Dependency Licensing

Details on how to resolve are provided below


Approvals

All proposed changes must be reviewed by project maintainers before they can be merged

Not enough people have approved this pull request - please ensure that 2 additional users, who have not contributed to this pull request approve the changes.

  • ❌ 2 additional approvals needed
     

@mihaiturcu
Copy link

@thilp can we get this approved?
Thanks

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.

error when transform from har to py using command line
2 participants