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

Models with custom root types show problem #226

Closed
chbndrhnns opened this issue Dec 14, 2020 · 3 comments
Closed

Models with custom root types show problem #226

chbndrhnns opened this issue Dec 14, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@chbndrhnns
Copy link

Describe the bug
Using a model with a custom root type makes PyCharm show a warning when instantiating such a model.

To Reproduce
Steps to reproduce the behavior:

from typing import List

from pydantic import BaseModel


class StorageAmountsDB(BaseModel):
    """StorageAmounts model (db)"""
    __root__: List = []


def test_root_type():
    StorageAmountsDB(__root__=[1])

Expected behavior
It is no problem to provide a __root__ argument.

Screenshots
Bildschirmfoto 2020-12-14 um 4 16 58 PM

Environments (please complete the following information):

  • IDE: PyCharm Professional 2020.3
  • OS: macOS 10.14
  • Pydantic Version: 1.7.3
  • Plugin version: 0.1.17

Additional context
Add any other context about the problem here.

@koxudaxi
Copy link
Owner

@chbndrhnns
Thank you for creating this issue.
Oh, I'm sorry. It's a bug. I removed the private attribute from the suggestion.
But, I forget that I must exclude __root__. I will fix it.

@koxudaxi koxudaxi added the bug Something isn't working label Dec 15, 2020
@chbndrhnns
Copy link
Author

it seems that can be closes as there is a fixed merged already, am I correct?

@koxudaxi
Copy link
Owner

koxudaxi commented Mar 9, 2021

I'm sorry.
I forgot to tell you it had released.

Yes, you are correct.
I closed it. Thank you.

@koxudaxi koxudaxi closed this as completed Mar 9, 2021
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

No branches or pull requests

2 participants