Closed scorpp closed 3 years ago
@scorpp thank for your report. I'm unable to reproduce it. I'v linted the following code:
from openpyxl import Workbook
from openpyxl.worksheet.table import Table, TableStyleInfo
if __name__ == '__main__':
wb = Workbook()
ws = wb.create_sheet('Sheet name')
table_style = TableStyleInfo(
name='TableStyleMedium9',
showFirstColumn=False,
showLastColumn=False,
showRowStripes=True,
)
data_table1 = Table(
name=f'Data',
displayName=f'Data',
ref=f'A2:C4',
tableStyleInfo=table_style,
)
ws.add_table(data_table1) # this line causes error
in two different virtual environments (python 3.6.9
and python 3.7.9
with various branches of pylint
and astroid
. None of them triggered the problem your are facing.
I got:
************* Module bug_pylint_3991
bug_pylint_3991.py:1:0: C0114: Missing module docstring (missing-module-docstring)
bug_pylint_3991.py:14:13: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
bug_pylint_3991.py:15:20: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
bug_pylint_3991.py:16:12: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
------------------------------------------------------------------
Your code has been rated at 5.00/10 (previous run: 5.00/10, +0.00)
with:
pylint 2.6.0
astroid 2.4.2
Python 3.6.9 (default, Dec 28 2020, 18:50:27)
[GCC 7.5.0]
or
pylint 2.6.0
astroid 2.4.2
Python 3.7.9 (default, Dec 19 2020, 14:12:54)
[GCC 7.5.0]
or even:
pylint 2.6.1-dev1
astroid 2.5.0
Python 3.6.9 (default, Dec 28 2020, 18:50:27)
[GCC 7.5.0]
Maybe the issue is linked to the version of openpyxl
. In all cases i used 3.0.5
.
The output looks extremely similar to https://github.com/PyCQA/astroid/issues/819. I bet it's the same root cause, a missing parent
in dunder method inference. @scorpp If you are able to test with the latest version of astroid
from its master
branch against your code, that would be great. I think it will pass with the latest, but let us know if not and we'll reopen the ticket.
@hippo91 you were right regarding the openpyxl! I was able to reproduce the issue with astroid==2.4.0 and openpyxl==2.6.1.
but at same time i can confirm that astroid version from master
fixes this issue!
thank you guys for looking into this and maintaining great tool! issue resolved.
Steps to reproduce
Current behavior
Expected behavior
pylint doesn't crash
pylint --version output
Latest pylint & astroid from master branches. Also reproduces with latest release versions (2.6.0 & 2.4.2)