Skip to content

Commit

Permalink
Fix intermittent test failure in tests/test_message_meta.py (nv-morph…
Browse files Browse the repository at this point in the history
…eus#772)

We had two tests that set values on row 3, however we now randomly duplicate the index, causing a situation where 3 might not exist in the index.

Authors:
  - David Gardner (https://github.com/dagardner-nv)

Approvers:
  - Michael Demoret (https://github.com/mdemoret-nv)

URL: nv-morpheus#772
  • Loading branch information
dagardner-nv authored Mar 17, 2023
1 parent 7aa6a7f commit 05d45f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_message_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ def test_mutable_dataframe(df: cudf.DataFrame):
meta = MessageMeta(df)

with meta.mutable_dataframe() as df:
df['v2'][3] = 47
df['v2'].iloc[3] = 47

assert meta.copy_dataframe()['v2'][3] == 47
assert meta.copy_dataframe()['v2'].iloc[3] == 47


def test_using_ctx_outside_with_block(df: cudf.DataFrame):
Expand Down Expand Up @@ -136,5 +136,6 @@ def test_copy_dataframe(df: cudf.DataFrame):
assert copied_df is not df, "But should be different instances"

# Try setting a single value on the copy
meta.copy_dataframe()['v2'][3] = 47
cdf = meta.copy_dataframe()
cdf['v2'].iloc[3] = 47
assert assert_df_equal(meta.copy_dataframe(), df), "Should be identical"

0 comments on commit 05d45f5

Please sign in to comment.