I would add the check as the first line of the generate_me_df function https://github.com/CMSTrackerDPG/DQMExplore/blob/6ee04b84eab9a78c302ffc13e47c8a3096d99a09/src/dqmexplore/dataproc.py#L8