-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
typing.ClassVar in model is no longer understood / recognised - False unresolved attribute reference #899
Comments
Perhaps related to #894 |
I have similar problem with this code: class Test(BaseModel):
_url: str = "https://someurl"
def get(self):
print(self._url) # Unresolved attribute reference '_url' for class 'Test' I suspect bugs with #858. Maybe private attributes shouldn't be checked as those are generally ignored by Pydantic anyway. @skewty, I believe #894 is solved in latest release, I couldn't reproduce it. |
getting the same as @viktorkertesz since update to 0.4.12 |
This also relates to inner classes: from pydantic import BaseModel
class Model(BaseModel):
class Inner(BaseModel):
user: str
group: str
vlan_id: int
name: str
def test_():
Model.Inner() |
|
@koxudaxi if you could give me a quick intro / tour of the plug-in code and where you expect the issue to be, I'd be willing to help out with some of these fixes.. I am expecting my work load to drop off some at the end of this week and I can probably dig into this one. |
Sorry I have not been able to respond due to a pile of tasks. Direct warnings are output here.
Currently, classVar is excluded from the pydantic field support in the filter here.
Perhaps an additional argument is needed to disable this I want to do this when I have time, but it is a bit difficult to do today. |
I think the case with an inner class worked before the last release. My use case is a builder class that I put as an inner class to a model |
I have sat down a few times to learn how this plugin works but find myself lacking the time to learn everything / enough to fix this issue. I started with some videos on YouTube and learned about PSI and ... this plugin / your work was featured in an interview for a reason.. It may very well be one of their most complex / fancy plugins. Congrats. |
+1 this issue 👍🏻 My code is now full of Any kind of Includes (probably partial list):
|
I got help from Jetbrains to re-enable unittest in 2024.1. |
@skewty I know everyone requests me for bug fixes and additional features for my OSS, including the plugin. I have the critical task of making slides for next month's PyConUS talk this week, but I promise to start working on the issue this weekend. |
Open-Source Exploitation - https://youtu.be/9YQgNDLFYq8?si=fkC41JH0iFwLoR77&t=1325 I feel I understand. I don't want to burn you out and I don't want this to become undesirable to support. For othersIf this bug affects you greatly, you should probably be supporting this project financially. |
I am seeing a regression in the newest plugin build / version.
ClassVar regression.
I can Ctrl-Click on TEST and it goes to the correct place in source code and it pulls up correct documentation on hover for that value. It is odd that the inspection comes up.
The text was updated successfully, but these errors were encountered: