ArtesiaWater / hydropandas

Module for loading observation data into custom DataFrames
https://hydropandas.readthedocs.io
MIT License
52 stars 10 forks source link

Deal with metadataheader not being present #213

Closed Florisklooster closed 2 months ago

Florisklooster commented 2 months ago

In B44H0400001 (I added the file + an other 'normal' file) no metadata and no metadata header is present, I got a keyerror exception, because the code tries to pop a key that would normally be in the metadata (it tried to pop 'startdatum').

In the proposed change is a way to deal with it, although there are many (maybe more chique) ways, so feel free to do it otherwise. btw I don't think there are a lot of files without metadata header, so maybe a try and except statement will do nicely

B44F0279001.csv B44H0400001.csv

OnnoEbbens commented 2 months ago

Thanks, the failing test seems not related to this PR so I will merge into 'dev'