def generator_then_call(generator, func: Callable):
    """
    Yield items from generator then execute a function and yield
    its result.
    """
    yield from generator
    yield func() or []

    Yield items from generator then execute a function and yield
    its result.
    
src/datachain/query/dataset.py