from typing import Iterable, Set, Tuple

from .sdk import LookmlModel


def lookml_explore_names(
    lookmls: Iterable[LookmlModel],
) -> Set[Tuple[str, str]]:
    """
    Explores from the lookml models
    Only valid explores are yielded: with all infos
    """
    model_explores = (
        (model, explore)
        for model in lookmls
        for explore in model.explores or []
    )

    return {
        (model.name, explore.name)
        for model, explore in model_explores
        # accept hidden resources
        if model.name and explore.name
    }
