def collect_flatten(self, *, row_factory=None, include_hidden: bool = True):
        """Yields flattened rows of values as a tuple.

        Args:
            row_factory : A callable to convert row to a custom format.
                          It should accept two arguments: a list of column names and
                          a tuple of row values.
            include_hidden: Whether to include hidden signals from the schema.
        """
        db_signals = self._effective_signals_schema.db_signals(
            include_hidden=include_hidden
        )
        with self._query.ordered_select(*db_signals).as_iterable() as rows:
            if row_factory:
                rows = (row_factory(db_signals, r) for r in rows)  # type: ignore[assignment]
            yield from rows
Yields flattened rows of values as a tuple.

        Args:
            row_factory : A callable to convert row to a custom format.
                          It should accept two arguments: a list of column names and
                          a tuple of row values.
            include_hidden: Whether to include hidden signals from the schema.
        
src/datachain/lib/dc/datachain.py