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

Plugin causes "Unresolved attribute reference" #984

Closed
PC-Gonzales opened this issue Sep 16, 2024 · 2 comments
Closed

Plugin causes "Unresolved attribute reference" #984

PC-Gonzales opened this issue Sep 16, 2024 · 2 comments

Comments

@PC-Gonzales
Copy link

PC-Gonzales commented Sep 16, 2024

Describe the bug
While Pydantic plugin is active, any pydantic class attribute gets "Unresolved Attribute Reference" warnings when accessing the class attribute (ie Example.my_atb). If plugin is disabled, the warning doesn't appear.

This started appearing after the last patch (0.4.15).

Tried invalidating caches, issue persisted.

To Reproduce
Steps to reproduce the behavior:

  1. Create Pydantic class with a class attribute.
  2. Attempt to access class-level attribute.
  3. Receive warning "Unresolved attribute reference"

Expected behavior
Warning shouldn't be appearing as this is a valid class attribute.

Screenshots
Plugin Enabled:
image
image

Plugin Disabled:
image

Environments (please complete the following information):
PyCharm 2024.2.1 (Community Edition)
Build #PC-242.21829.153, built on August 29, 2024
Runtime version: 21.0.3+13-b509.11 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2040M
Cores: 16
Registry:
ide.experimental.ui=true
i18n.locale=
Non-Bundled Plugins:
com.jetbrains.plugins.ini4idea (242.21829.162)
com.intellij.ml.llm (242.21829.196)
org.jetbrains.plugins.gitlab (242.21829.162)
com.koxudaxi.pydantic (0.4.15)
ru.adelf.idea.dotenv (2024.2.1)

Pydantic Packages:

  • pydantic==2.9.1
  • pydantic_settings==2.5.2
  • pydantic_core==2.23.3
@Dawdre
Copy link

Dawdre commented Dec 7, 2024

Bump - Seeing the same problem pydantic==2.6.1

@PC-Gonzales
Copy link
Author

"Pydantic definition and usages" inspection was enabled, causing the issue.
Confusion was caused by outdated image from https://plugins.jetbrains.com/plugin/12861-pydantic
screenshot_21646

@Dawdre Make sure your inspections are like this:
image

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

No branches or pull requests

2 participants