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

pylint error for orjson #248

Closed
michaeldorner opened this issue Apr 11, 2022 · 6 comments
Closed

pylint error for orjson #248

michaeldorner opened this issue Apr 11, 2022 · 6 comments

Comments

@michaeldorner
Copy link

pylint gives a no-member error for orjson:

Module 'orjson' has no 'loads' member

It must be a false-positive error since orjson works like a charm. Any ideas for an easy fix?

@ijl
Copy link
Owner

ijl commented Apr 15, 2022

I've see pylint do that with extensions and I don't know of anything this project can do differently.

@ijl ijl closed this as completed Apr 15, 2022
@michaeldorner
Copy link
Author

michaeldorner commented May 18, 2022

Just for the sake of completeness and future readers: You can simply disable the pylint warning for the line(s) in which you use orjson by the following comment:

orjson.dumps(result)  # pylint: disable=maybe-no-member

@dpinol
Copy link

dpinol commented Jul 2, 2024

Since I don't see any difference with other projects, I created pylint bug pylint-dev/pylint#9762

@dk-coligo
Copy link

dk-coligo commented Jul 3, 2024

If using VSCode, suppress the warning with:

{
 ...
  "pylint.args": [
          "--extension-pkg-allow-list=orjson",
      ],
 ...
}

in your settings.json

@ozooner
Copy link

ozooner commented Sep 16, 2024

Can be fixed by whitelisting orjson to your .pylintrc file
extension-pkg-whitelist=orjson

@philip4096
Copy link

Or

[tool.pylint]
extension-pkg-whitelist = ["orjson"]

in a pyproject.toml if you are using one.

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

6 participants