def METHOD_NAME(
    dag: DAG, artifact_id: uuid.UUID, new_artifact_type: ArtifactType
) -> None:
    """Update's the type for an untyped artifact in the DAG.
    Fails if there is a type mismatch with an already existing type. This is safe to use as much
    as you want (eg. for backfills), since it will not change types arbitrarily.
    """
    artifact = dag.must_get_artifact(artifact_id)
    existing_type_annotation = artifact.type
    if (
        existing_type_annotation != ArtifactType.UNTYPED
        and existing_type_annotation != new_artifact_type
    ):
        raise InvalidArtifactTypeException(
            "The artifact `%s` was expected to have type %s, but instead computed type %s"
            % (artifact.name, existing_type_annotation, new_artifact_type)
        )
    # If the artifact was already typed, we've verified that the type does not change above.
    if existing_type_annotation == ArtifactType.UNTYPED:
        dag.update_artifact_type(artifact_id, new_artifact_type)