def _find_row(dogs: DynamicFrame, breed: str):
    """ Find the only row matching the given breed in the Dynamic Frame of dog records
      If no rows exist or more than one row exists with the given breed, fail the test
  """
    matches = dogs.filter(lambda x: x['breed'] == breed).toDF().collect()
    assert len(matches) == 1
    return matches[0]
Example #2
0
def _find_row(paintings: DynamicFrame, episode_text: str):
    """ Assert a given row exists in the dynamic frame and that it contains the expected values """
    matches = paintings.filter(
        lambda x: x['season_episode_text'] == episode_text).toDF().collect()
    assert len(matches) == 1
    return matches[0]