Fix read parquet import error message
State: closed

- [x] closes #33313
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry  N/A

`pandas.io.parquet.get_engine()` uses handling of `ImportError`s for flow control to decide which parquet reader engine is used. In doing so, it quashed lower-level error messages that would have been helpful to the user attempting to diagnose the error, replacing it with a misleading error message. 

I refactored the error handling, allowing for these lower-level error messages to be collected and explicitly "bubbled up". Thus fixing the incorrect error message.

No tests added -- this behaviour is not worthy of testing. Presumably not worthy of a whatsnew entry either.

Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO Parquet
description: parquet, feather

Comments:
@datapythonista Could I get you to point me to an existing test that tests for error messages? It isn't something I've done before, so I'd like to lean on something pre-existing. 
@datapythonista In particular, I'm not sure what the best way is to mock the absence or wrong version of a dependency, respectively... 
I'm in my phone right now. Can you grep for `pytest.raises(ImportError` in the `tests` directory? There is a `match` parameter to check the error message. Thanks! 
Ok, found in `test_optional_dependency.py`. 
My problem is, I'm not sure how to monkeypatch the version of `pyarrow` to something bad, without screwing up later tests. I guess I could make a fixture that sets `pyarrow.__version__='bad.version.42'`, and then set the version back to what it was during teardown, but that seems... not perfectly safe? Or is it ok?
Bit beyond what I've done before, therefore this handholding!
Sorry, wasn't my idea to make things too complicated.

In general, we use pytest markers to run or skip tests depending on whether certain dependencies are installed. I think we're already doing it for `pyarrow` and `fastparquet`. For testing the error when the version is too old, I think you can simply use an `if pyarrow.__version__ > whatever`. Then you'll be testing one error message or the other depending on which version of `pyarrow` is installed.

In the CI we should have builds with new versions, and with the oldest we support. So, both tests should be executed in one build or another.

Does this sound more reasonable? I guess we can live without this test if it's too complicated, but I think doing this should be quite straight forward.
can you show what the error message results in now?
@jreback Sure. See the example below, the last three lines in particular.
Also the test I just added documents this. (`pandas/tests/io/test_parquet.py::test_get_engine_auto_error_message`)
```
>>> from pandas.io.parquet import get_engine
>>> import pyarrow
>>> import fastparquet
>>> pyarrow.__version__ = '0.0.42'
>>> fastparquet.__version__ = '0.0.1'
>>> get_engine("auto")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\JEACO\repos\pandas\pandas\io\parquet.py", line 32, in get_engine
    "Unable to find a usable engine; "
ImportError: Unable to find a usable engine; tried using: 'pyarrow', 'fastparquet'.
A suitable version of pyarrow or fastparquet is required for parquet support.
Trying to import the above resulted in these errors:
Pandas requires version '0.13.0' or newer of 'pyarrow' (version '0.0.42' currently installed).
Pandas requires version '0.3.2' or newer of 'fastparquet' (version '0.0.1' currently installed).
```
thanks @jfcorbett