class_docstr: This test will validates the card component API based for runtime updates.
class_docstr_tok: ["This","test","will","validates","the","card","component","API","based","for","runtime","updates","."]
code: def check_results(self, flow, checker):
      def _array_is_a_subset(arr1, arr2):
          return set(arr1).issubset(set(arr2))
  
      if checker.__class__.__name__ != "MetadataCheck":
          return
      run = checker.get_run()
      for step in flow:
          meta_check_dict = checker.artifact_dict_if_exists(
              step.name, "final_data"
          )
          # Which ever steps ran the actual card testing code
          # contains the `final_data` attribute and the `step_name` attribute.
          # If these exist then we can succesfully validate the card data since it is meant to exist.
          step_done_check_dict = checker.artifact_dict_if_exists(
              step.name, "step_name"
          )
          for task_id in step_done_check_dict:
              if (
                  len(step_done_check_dict[task_id]) == 0
                  or step_done_check_dict[task_id]["step_name"]
                  != step.name
              ):
                  print(
                      "Skipping task pathspec %s"
                      % run[step.name][task_id].pathspec
                  )
                  continue
              # If the `step_name` attribute was set then surely `final_data` will also be set;
              data_obj = meta_check_dict[task_id]["final_data"]
              card_present, card_data = checker.get_card_data(
                  step.name,
                  task_id,
                  "test_component_refresh_card",
                  card_id="refresh_card",
              )
              assert_equals(card_present, True)
              data_has_latest_artifact = _array_is_a_subset(
                  data_obj, card_data["data"]["component_1"]["abc"]
              )
              assert_equals(data_has_latest_artifact, True)
              print(
                  "Succesfully validated task pathspec %s"
                  % run[step.name][task_id].pathspec
              )
  
imports: from metaflow_test import MetaflowTest, ExpectationFailed, steps, tag
label_desc: Use image node_id 3 for calling the CardComponentRefreshTest obj's underlying member method code with example usage: obj.check_results(flow, checker) and returns: set