Pylint: False abstract-class-instantiated with pandas.ExcelWriter

Created on 13 Aug 2019  Â·  16Comments  Â·  Source: PyCQA/pylint

Hello,

Steps to reproduce

Run pylint on the following code:

"""Lorem ipsum"""

import pandas as pd


def demo():
    """Demo for the false positive"""
    with pd.ExcelWriter("demo.xlsx") as writer:
        print(writer)

Current behavior

Pylint gives: abstract-class-instantiated(E0110): test.py:8:9: demo: Abstract class 'ExcelWriter' with abstract methods instantiated

Expected behavior

No issue

pylint --version output

  • Astroid 2.2.5
  • Pylint 2.3.1
  • Python 3.7.4
  • GCC 7.4.0

Discussion

This ticket has originally been opened on pandas github: https://github.com/pandas-dev/pandas/issues/27634

According to the discussions there, it seems that pylint has issues with introspection of objects defining __new__

bug

Most helpful comment

To save y'all 10s here is the comment line to temporarily disable this error and point to this page:
# https://github.com/PyCQA/pylint/issues/3060 pylint: disable=abstract-class-instantiated

All 16 comments

I just ran into this exact issue.

Thanks for the report folks!

You're welcome. Thanks for your help.

Le ven. 16 août 2019 17:22, Claudiu Popa notifications@github.com a
écrit :

Thanks for the report folks!

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/PyCQA/pylint/issues/3060?email_source=notifications&email_token=ABYIHFTFNBN6FLJGJPQ6LQTQE3A4DA5CNFSM4ILLMDY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4O5E4Y#issuecomment-522048115,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABYIHFXN7REEB5LVEZYNEFDQE3A4DANCNFSM4ILLMDYQ
.

To save y'all 10s here is the comment line to temporarily disable this error and point to this page:
# https://github.com/PyCQA/pylint/issues/3060 pylint: disable=abstract-class-instantiated

+1

Guys, this is driving me mad, could someone please tell me how to implement a temporary fix.

@UrAvgDeveloper this is what I did to disable this check globally, you need a .pylintrc file, look for [MESSAGES CONTROL] then for disable= and add abstract-class-instantiated
image

I encountered the same issue.

I get a pylint message on the line:
writer = pd.ExcelWriter(output, engine='xlsxwriter')

'Abstract class ExcelWriter with abstract methods instantiated'

pandas==0.25.3

same issue as of today
writer = pd.ExcelWriter('path to file')
'Abstract class 'ExcelWriter' with abstract methods instantiated'

Same here.
Used the following syntax as a temporary fix:
with pd.ExcelWriter(outfile_name) as xl_writer: #pylint: disable=abstract-class-instantiated

Same as of today:
(abstract-class-instantiated)Abstract class 'ExcelWriter' with abstract methods instantiated

+1 Abstract class 'ExcelWriter' with abstract methods instantiatedpylint(abstract-class-instantiated)

For me as well:
Abstract class 'ExcelWriter' with abstract methods instantiated

Me too :(

with pd.ExcelWriter(outfile_name) as xl_writer: #pylint: disable=abstract-class-instantiated

Doesn't this just thrown a line length error?

with pd.ExcelWriter(outfile_name) as xl_writer: #pylint: disable=abstract-class-instantiated

Doesn't this just thrown a line length error?

Not in my case... I didn't change any of the pylint's defaults.
In any case, one can adjust that setting: https://stackoverflow.com/questions/52058886/visual-studio-code-with-pylint-and-autopep8-how-can-i-avoid-pylint-to-complain

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TBoshoven picture TBoshoven  Â·  3Comments

thanatos picture thanatos  Â·  3Comments

ethanchewy picture ethanchewy  Â·  3Comments

adamtheturtle picture adamtheturtle  Â·  3Comments

elirnm picture elirnm  Â·  3Comments