Test a pandas dataframe.
(
state,
name,
columns=None,
undefined_msg=None,
not_data_frame_msg=None,
undefined_cols_msg=None,
incorrect_msg=None,
)
| 28 | |
| 29 | |
| 30 | def test_data_frame( |
| 31 | state, |
| 32 | name, |
| 33 | columns=None, |
| 34 | undefined_msg=None, |
| 35 | not_data_frame_msg=None, |
| 36 | undefined_cols_msg=None, |
| 37 | incorrect_msg=None, |
| 38 | ): |
| 39 | """Test a pandas dataframe. |
| 40 | """ |
| 41 | |
| 42 | expand_msg = ( |
| 43 | "" |
| 44 | if undefined_msg or not_data_frame_msg or undefined_cols_msg or incorrect_msg |
| 45 | else None |
| 46 | ) |
| 47 | |
| 48 | child = check_df( |
| 49 | state, |
| 50 | name, |
| 51 | undefined_msg, |
| 52 | not_instance_msg=not_data_frame_msg, |
| 53 | expand_msg=expand_msg, |
| 54 | ) |
| 55 | |
| 56 | # if columns not set, figure them out from solution |
| 57 | if columns is None: |
| 58 | columns = getColumnsInProcess(name, child.solution_process) |
| 59 | |
| 60 | for col in columns: |
| 61 | colstate = check_keys(child, col, missing_msg=undefined_cols_msg) |
| 62 | has_equal_value(colstate, incorrect_msg=incorrect_msg) |
nothing calls this directly
no test coverage detected