tfx/orchestration/portable/input_resolution/mlmd_resolver/metadata_resolver.py [301:332]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      )

    if store is None:
      store = self._store
    if store is None:
      raise ValueError('MetadataStore provided to MetadataResolver is None.')

    artifact_ids_str = ','.join(str(id) for id in artifact_ids)
    # If `max_num_hops` is set to 0, we don't need the graph traversal.
    if max_num_hops == 0:
      if not filter_query:
        artifacts = store.get_artifacts_by_id(artifact_ids)
      else:
        artifacts = store.get_artifacts(
            list_options=mlmd.ListOptions(
                filter_query=f'id IN ({artifact_ids_str}) AND ({filter_query})',
                limit=_MAX_NUM_STARTING_NODES,
            )
        )
      artifact_type_ids = [a.type_id for a in artifacts]
      artifact_types = store.get_artifact_types_by_id(artifact_type_ids)
      artifact_type_by_id = {t.id: t for t in artifact_types}
      return {
          artifact.id: [(artifact, artifact_type_by_id[artifact.type_id])]
          for artifact in artifacts
      }

    options = metadata_store_pb2.LineageSubgraphQueryOptions(
        starting_artifacts=metadata_store_pb2.LineageSubgraphQueryOptions.StartingNodes(
            filter_query=f'id IN ({artifact_ids_str})'
        ),
        max_num_hops=max_num_hops,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tfx/orchestration/portable/input_resolution/mlmd_resolver/metadata_resolver.py [590:621]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      )

    if store is None:
      store = self._store
    if store is None:
      raise ValueError('MetadataStore provided to MetadataResolver is None.')

    artifact_ids_str = ','.join(str(id) for id in artifact_ids)
    # If `max_num_hops` is set to 0, we don't need the graph traversal.
    if max_num_hops == 0:
      if not filter_query:
        artifacts = store.get_artifacts_by_id(artifact_ids)
      else:
        artifacts = store.get_artifacts(
            list_options=mlmd.ListOptions(
                filter_query=f'id IN ({artifact_ids_str}) AND ({filter_query})',
                limit=_MAX_NUM_STARTING_NODES,
            )
        )
      artifact_type_ids = [a.type_id for a in artifacts]
      artifact_types = store.get_artifact_types_by_id(artifact_type_ids)
      artifact_type_by_id = {t.id: t for t in artifact_types}
      return {
          artifact.id: [(artifact, artifact_type_by_id[artifact.type_id])]
          for artifact in artifacts
      }

    options = metadata_store_pb2.LineageSubgraphQueryOptions(
        starting_artifacts=metadata_store_pb2.LineageSubgraphQueryOptions.StartingNodes(
            filter_query=f'id IN ({artifact_ids_str})'
        ),
        max_num_hops=max_num_hops,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



