kennethreitz / records

SQL for Humans™
https://pypi.python.org/pypi/records/
ISC License
7.16k stars 574 forks source link

Failing export to xlsx #142

Closed vlcinsky closed 6 years ago

vlcinsky commented 6 years ago

Trying to export to xlsx, it fails with error:

$ records stat.sql xlsx >t.xlsx
/home/javl/sandbox/playwith_records/records/.tox/py36/lib/python3.6/site-packages/psycopg2/__init__.py:14
4: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing
from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/
docs/install.html#binary-install-from-pypi>.
  """)
Traceback (most recent call last):
  File "/home/javl/sandbox/playwith_records/records/.tox/py36/bin/records", line 11, in <module>
    sys.exit(cli())
  File "/home/javl/sandbox/playwith_records/records/.tox/py36/lib/python3.6/site-packages/records.py", li
ne 527, in cli
    content = rows.export(format)
  File "/home/javl/sandbox/playwith_records/records/.tox/py36/lib/python3.6/site-packages/records.py", li
ne 167, in export
    return self.dataset.export(format, **kwargs)
  File "/home/javl/sandbox/playwith_records/records/.tox/py36/lib/python3.6/site-packages/tablib/core.py"
, line 467, in export
    return export_set(self, **kwargs)
  File "/home/javl/sandbox/playwith_records/records/.tox/py36/lib/python3.6/site-packages/tablib/formats/
_xlsx.py", line 43, in export_set
    dset_sheet(dataset, ws, freeze_panes=freeze_panes)
  File "/home/javl/sandbox/playwith_records/records/.tox/py36/lib/python3.6/site-packages/tablib/formats/
_xlsx.py", line 122, in dset_sheet
    cell = ws.cell('%s%s' % (col_idx, row_number))
TypeError: cell() missing 1 required positional argument: 'column'

It seems it relates to https://github.com/kennethreitz/tablib/issues/324 with PR which got somehow forgotten.

Temporary solution (until the tablib issue is fixed) is to downgrade openpyxl to 2.4.11

felciano commented 4 years ago

@vlcinsky any update on this issue? It looks like the referenced https://github.com/jazzband/tablib/issues/324 tablib issue was fixed last year. Is there an outlook to removing the downgrade and allowing records to use more current versions of pyopenxl?