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 complains about: "E1101: Instance of '' has no 'Object' member (no-member)" for boto3 resources #3261

Closed
mludvig opened this issue Nov 18, 2019 · 1 comment
Labels
Duplicate 🐫 Duplicate of an already existing issue

Comments

@mludvig
Copy link

mludvig commented Nov 18, 2019

Somehow pylint 2.3 and newer started complaining about a simple boto3 resources. It can be easily reproduced in a clean docker container.

  1. Start the container and install the newest boto3 and pylint.

    $ docker run --rm -it python:3.7 bash
    root@0ebc7eb0b8d9:/# pip install pylint boto3
    [...]
    Successfully installed astroid-2.3.3 boto3-1.10.20 botocore-1.13.20 docutils-0.15.2 isort-4.3.21 jmespath-0.9.4 lazy-object-proxy-1.4.3 mccabe-0.6.1 pylint-2.4.4 python-dateutil-2.8.0 s3transfer-0.2.1 six-1.13.0 typed-ast-1.4.0 urllib3-1.25.7 wrapt-1.11.2
    
  2. Create a very simple test file:

    root@0ebc7eb0b8d9:/# cat > test-pylint-boto3.py 
    import boto3
    
    sqs = boto3.resource('sqs')
    sqs_queue = sqs.Queue(url='http://...')         # <<< pylint doesn't like this
    
    s3 = boto3.resource('s3')
    s3_obj = s3.Object(bucket_name='boto3', key='test.py')            # <<< and this
    
  3. Now run pylint:

    root@0ebc7eb0b8d9:/# pylint -E test-pylint-boto3.py 
    ************* Module test-pylint-boto3
    /test-pylint-boto3.py:4:12: E1101: Instance of '' has no 'Queue' member (no-member)
    /test-pylint-boto3.py:7:9: E1101: Instance of '' has no 'Object' member (no-member)
    
  4. The latest one that worked was pylint == 2.2.3. Downgrade to that version and verify clean run:

    root@0ebc7eb0b8d9:/# pip install 'pylint<2.3'
    Collecting pylint<2.3
    ...
    Successfully installed astroid-2.1.0 pylint-2.2.3
    
    root@0ebc7eb0b8d9:/# pylint -E test-pylint-boto3.py 
    root@0ebc7eb0b8d9:/# 
    

TL;DR
With pylint==2.3.0 something changed and pylint can no longer be used with boto3. It doesn't depend on boto3 versions, I tried a few major ones back and the new pylint keeps throwing this error regardless of the boto3 version.

Can we get boto3 support back please?

@PCManticore
Copy link
Contributor

Thanks for the report. This is a duplicate of #3134. Also it's not like we "took" boto3 support from you intentionally. There probably is a bug somewhere in the inference which prevents properly inferring boto3 types, but we did not have time yet to further investigate the cause of that.

@PCManticore PCManticore added the Duplicate 🐫 Duplicate of an already existing issue label Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants