-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RDRP-1068_python_311_errors #394
Conversation
…fied validation to account for columns that only contain nan values
@@ -156,7 +156,8 @@ def validate_data_with_schema(survey_df: pd.DataFrame, schema_path: str): # noq | |||
" the data." | |||
) | |||
else: | |||
survey_df[column] = survey_df[column].astype(dtypes_dict[column]) | |||
if survey_df[column].isna().all() is False: | |||
survey_df[column] = survey_df[column].astype(dtypes_dict[column]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for this change is that unlike BERD backdata, PNP backdata contains columns with only nan values. When the original line 159 would run it would throw an error because of this. Line 159 now checks if the column does not only contain nan values, and if so executes line 160 as normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a really good solution- thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good that you found the cause of the issue and gave us a solution, thank you.
Pull Request submission
Insert detailed bullet points about your changes here!
Insert any instructions to help the reviewer, e.g. "install new requirements from
requirements.txt
"*Let the reviewer know what data files are needed (and if applicable, where they are to be found)
Closes or fixes
Closes #
Code
Documentation
Any new code includes all the following forms of documentation:
Args
andreturns
for all major functionsData
Testing
Peer Review Section
requirements.txt
Final approval (post-review)
The author has responded to my review and made changes to my satisfaction.
Review comments
Insert detailed comments here!
These might include, but not exclusively:
that it is likely to interact with?)
works correctly?)
Your suggestions should be tailored to the code that you are reviewing.
Be critical and clear, but not mean. Ask questions and set actions.