I prefer going the long route. These are the checks I follow to avoid using a try-except clause -
- check if variable is not None
- then check if its a dataframe and
- make sure its not empty
Here, DATA is the suspect variable -
DATA is not None and isinstance(DATA, pd.DataFrame) and not DATA.empty