Giter VIP home page Giter VIP logo

Comments (4)

erictraut avatar erictraut commented on May 18, 2024

Pylance requires type stubs to do the best job possible with type analysis. In this case, I'm presuming that you don't have a type stub available for celery, so it is doing its best to infer types from the library implementation based on the return type(s) of shared_task. In this particular case, shared_task returns two different types, and the type checker can't tell which one is returned for this particular call site. Both types are functions, but one of them is a function that requires a parameter called fun, hence the error.

The best workaround in this case is to find (or create) a type stub for the celery package. A type stub will provide the proper annotations so the type checker can perform analysis correctly in this case without emitting an error.

If you can't find a type stub and don't want to create one, you can suppress this error using "# type: ignore".

from pylance-release.

erictraut avatar erictraut commented on May 18, 2024

I've updated the "missing argument" diagnostic to be off by default when typeCheckingMode is "off". Assuming that you haven't set typeCheckingMode to "basic" or "strict", this diagnostic will be suppressed. This change will be in the next version of Pylance.

from pylance-release.

remihuguet avatar remihuguet commented on May 18, 2024

ok thanks you very much for your feedback. I'll try to add so type stub for celery 👍

By the way, this is a great extension, very nice work 👏

from pylance-release.

jakebailey avatar jakebailey commented on May 18, 2024

This issue has been fixed in version 2020.7.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202070-9-july-2020

from pylance-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.