-
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
fixed issue with run live or frozen #119
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
target,error,live,frozen | ||
1,C,1,1 | ||
2,E,2, | ||
3,O,3,3 | ||
4,W,4, | ||
5,C,5,5 | ||
6,E,6, | ||
7,W,7, | ||
target,error,live,frozen,frozen_error | ||
2,C,2,2, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does frozen_error have a numerical type? Does this not relate to the other error in col2? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Frozen_error contains the deleted adjusted values. |
||
7,E,7,,7 | ||
1,O,1,1, | ||
6,W,6,,6 | ||
3,C,3,3, | ||
5,E,5,,5 | ||
4,W,4,,4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,13 +104,16 @@ def test_run_live_or_frozen(filepath): | |
|
||
df = pd.read_csv(filepath / "test_run_live_or_frozen.csv") | ||
|
||
df_in = df.drop(columns=["frozen"]) | ||
df_in = df.drop(columns=["frozen", "frozen_error"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guessing you are using one input data to have the input and correct output which is why its being dropper early in test? |
||
|
||
live_ouput = run_live_or_frozen(df_in, "target", "error", "live") | ||
|
||
frozen_output = run_live_or_frozen(df_in, "target", "error", "frozen") | ||
|
||
expected_output_frozen = df_in.copy() | ||
expected_output_frozen["target"] = df["frozen"] | ||
expected_output_frozen = df.copy() | ||
|
||
expected_output_frozen.drop(columns=["frozen"], inplace=True) | ||
expected_output_frozen = expected_output_frozen.fillna("") | ||
|
||
assert_frame_equal(frozen_output, expected_output_frozen) | ||
assert_frame_equal(live_ouput, df_in) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Never noticed this before, but what happens if the first assert fails, but the second passes? or vice versa? Just want to make sure the unit test fails if both or one fail There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checked together and it fails if either one fails. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorted this, agreed that if one fails the unit test fails. Only appears as one unit test though |
||
|
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.
Nice use of lambda function to simplify copying over the value from the target column :)