BUG: add 'import warnings' statement in panel.py (GH8152)

closes #8152.