Skip to content

read_table should check for engine name validity #16641

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

Closed
wavexx opened this issue Jun 8, 2017 · 1 comment
Closed

read_table should check for engine name validity #16641

wavexx opened this issue Jun 8, 2017 · 1 comment
Labels
Error Reporting Incorrect or improved errors from pandas IO CSV read_csv, to_csv

Comments

@wavexx
Copy link

wavexx commented Jun 8, 2017

We should really check for valid engine names for the engine argument to pd.read_table. An invalid name results in a dubious error to the user:

pd.read_table('', engine='test')
>>> Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pandas/io/parsers.py", line 646, in parser_f
    return _read(filepath_or_buffer, kwds)
  File "/usr/lib/python3/dist-packages/pandas/io/parsers.py", line 389, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/usr/lib/python3/dist-packages/pandas/io/parsers.py", line 730, in __init__
    self._make_engine(self.engine)
  File "/usr/lib/python3/dist-packages/pandas/io/parsers.py", line 929, in _make_engine
    self._engine = klass(self.f, **self.options)
UnboundLocalError: local variable 'klass' referenced before assignment
@chris-b1
Copy link
Contributor

chris-b1 commented Jun 8, 2017

Thanks for the report, this was closed by #16511 and is fixed in 0.20.2

@chris-b1 chris-b1 closed this as completed Jun 8, 2017
@chris-b1 chris-b1 added Error Reporting Incorrect or improved errors from pandas IO CSV read_csv, to_csv labels Jun 8, 2017
@chris-b1 chris-b1 added this to the No action milestone Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas IO CSV read_csv, to_csv
Projects
None yet
Development

No branches or pull requests

2 participants