Skip to content

Conversation

JackReevesEyre-NOAA
Copy link

@JackReevesEyre-NOAA JackReevesEyre-NOAA commented Jun 18, 2025

This PR fixes an issue with how columns are dropped in normalize_coops_stations.

As it was, df.drop was called with columns that might not exist, which would raise an exception. There was already logic in place to check if these columns existed, so I moved the df.drop to be within those if statements.

I ran the test suite (make test) and all the COOPS tests passed (overall, 166 passed, 30 warnings).

@pmav99
Copy link
Member

pmav99 commented Jun 20, 2025

Just for the record, another way to tackle this is to use:

df = df.drop([col1, col2, col3], errors="ignore")

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.drop.html

@JackReevesEyre-NOAA
Copy link
Author

The test that fails is only a single version and is related to NDBC tests, not CO-OPS (which is what I changed). So I'm not sure what to do with this... Any ideas @SorooshMani-NOAA @pmav99 ?

@pmav99
Copy link
Member

pmav99 commented Jul 2, 2025

the tests we have some providers are flaky. The first thing you should do is to restart/retry the failing tests, although it doesn't always help. If the failing test is not related to the changes in the code then we may merge even with failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants