Skip to content

Commit 5407dae

Browse files
committed
Updated NA checks to use correct testing functions
1 parent c8651c7 commit 5407dae

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/test_flow.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,14 @@ def test_na_for_unspecified_columns(tmp_path: Path):
215215
df = flow.load_csv_with_metadata(str(tmp_path), yaml_path)
216216
df.sort_values(by="well", inplace=True, ignore_index=True)
217217

218-
data = [["cond1", pd.NA, "A1", "singlets", 1, 2], [pd.NA, "cond2", "A2", "singlets", 10, 20]]
219-
df_manual = pd.DataFrame(
220-
data,
221-
columns=["condition", "second_condition", "well", "population", "channel1", "channel2"],
222-
)
223-
assert df.equals(df_manual)
218+
# can't directly check for NA, use the .isna commands
219+
# assert there are NA's where we expect
220+
assert pd.isna(df[df.well == 'A1']['second_condition']).all()
221+
assert pd.isna(df[df.well == 'A2']['condition']).all()
222+
223+
# and that there aren't NA's where there shouldn't be
224+
assert pd.notna(df[df.well == 'A1']['condition']).all()
225+
assert pd.notna(df[df.well == 'A2']['second_condition']).all()
224226

225227

226228
def test_passed_list_metadata(tmp_path: Path):

0 commit comments

Comments
 (0)