Fix bug in drop columns in normalize_coops_stations#178
Open
JackReevesEyre-NOAA wants to merge 1 commit intomasterfrom
Open
Fix bug in drop columns in normalize_coops_stations#178JackReevesEyre-NOAA wants to merge 1 commit intomasterfrom
JackReevesEyre-NOAA wants to merge 1 commit intomasterfrom
Conversation
Member
|
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 |
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 ? |
Member
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue with how columns are dropped in
normalize_coops_stations.As it was,
df.dropwas 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 thedf.dropto be within thoseifstatements.I ran the test suite (
make test) and all the COOPS tests passed (overall, 166 passed, 30 warnings).