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

Get errors on "from_dict": <class>.__init__() got multiple values for argument 'resource_type' #118

Closed
gshank opened this issue Jun 22, 2023 · 3 comments · Fixed by #119
Closed
Labels
bug Something isn't working

Comments

@gshank
Copy link
Contributor

gshank commented Jun 22, 2023

  • mashumaro version: 3.8
  • Python version: 3.10
  • Operating System: MacOS

Description

dbt Core: https://github.com/dbt-labs/dbt-core

I tested with 3.8 and got a lot of errors from a bunch of related classes that we distinguish on the field "resource_type".
E TypeError: AnalysisNode.init() got multiple values for argument 'resource_type'

Because some of these classes only differ in the value of the resource_type field, we've had to use a _deserialize method to distinguish among them: https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/contracts/graph/nodes.py#L381C16-L381C16

But now it's not even getting to that.

What I Did

Change mashumaro version to 3.8 and run pytest tests/unit.

If there's something that I can do to help diagnose, let me know.

@Fatal1ty
Copy link
Owner

Fatal1ty commented Jun 23, 2023

@gshank

Thank you for finding the bug so quickly. It's related to the latest optimisations.

All your unit tests are now passed, so I can release hotfix 3.8.1 now but if you have something else to check, I will wait for it. Just let me know.

P.S. This issue can also be avoided by using lazy compilation if you enable it in the root config:
https://github.com/dbt-labs/dbt-core/blob/533988233ecc1b2391d2d6139e1d6be095e2d6cd/core/dbt/dataclass_schema.py#L43-L49

Change mashumaro version to 3.8 and run pytest tests/unit.

Next time I will run these tests before release, they are very useful.

@Fatal1ty
Copy link
Owner

Fixed in 3.8.1

@gshank
Copy link
Contributor Author

gshank commented Jun 26, 2023

Thanks so much for the new release! I'm updating right now. I'll be using some of the new functionality in the next few weeks.

It would be great to have you run the tests before releasing. We'd like to unpin the mashumaro release but haven't been able to in the past.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants