Per the docstring the export_pandas method returns an object of type pandas.DataFrame however the return type was also None if no results were defined.
You can't simply check a pandas.DataFrame for truthiness and thus the following isn't valid,
df = client.export_pandas()
if df:
...
when you're returning a mix of None and pandas.DataFrame. Currently you would need to be the somewhat verbose:
df = client.export_pandas()
if df is not None and not df.empty():
...
This PR ensures the method always returns a pandas.DataFrame regardless of the results, i.e., one can simply use:
df = client.export_pandas()
if not df.empty():
...
Per the docstring the
export_pandas
method returns an object of typepandas.DataFrame
however the return type was alsoNone
if no results were defined.You can't simply check a
pandas.DataFrame
for truthiness and thus the following isn't valid,when you're returning a mix of
None
andpandas.DataFrame
. Currently you would need to be the somewhat verbose:This PR ensures the method always returns a
pandas.DataFrame
regardless of the results, i.e., one can simply use:to: @betodealmeida @mistercrunch