Pyright highlighting perfectly working astropy code as if it were incorrect

Question:

I was building a simulator for planets’ orbits, and pyright is really helpful for highlighting mistakes automatically, but for some reason it doesn’t understand perfectly working operations with astropy’s units and keeps highlighting it as if they were incorrect.

How can I make pyright ignore these operations? It probably involves editing pyrightconfig.json according to the link in the image below, but I’m a noob in both json and pyright/pylance, so I didn’t understand what I need to put in that file specifically.

Perfectly working astropy code being highlighted for no reason.

Also, I don’t know if that is a bug and I should report it, and if so, how do I do that?

Minimal code needed to reproduce:

from astropy import units
var = 3 * units.m

Answers:

If you want to ignore this warning, you can do the following steps:

Use "Ctrl+Shift+P" and search "Preferences: Open User Settings(JSON)"

enter image description here

Then add the following codes to settings.json:

  "python.analysis.diagnosticSeverityOverrides": {
    "reportGeneralTypeIssues": "none"
  },
Answered By: MingJie-MSFT