noaa-oar-arl / monetio

The Model and ObservatioN Evaluation Tool I/O package
https://monetio.readthedocs.io
MIT License
16 stars 19 forks source link

Handle latest version of pandas in airnow #147

Closed lambertaa closed 7 months ago

lambertaa commented 7 months ago

Currently, the airnow module uses an iteration of pd.read_csv() that uses error_bad_lines and warn_bad_lines arguments. These arguments do not exist in the latest versions of pandas (>=1.3.0). The try/except captures the error and outputs an empty dataframe. So, the result of airnow.add_data(...) is an empty dataframe.

For up to date pandas versions, these arguments are replaced with on_bad_lines with options of 'error', 'warn', or 'skip'. Replacing the deprecated arguments with on_bad_lines produces the desired result.

zmoon commented 7 months ago

Hi @lambertaa , thanks much for reporting this. I have addressed this in #146, but it hasn't been merged yet. I am going to close this in favor of #111 which includes other things that need to be addressed for pandas v2 support.