def to_stream_type( self, stream_type: StreamType, step: AutoCount = AUTO, verbose: AutoBool = AUTO, **kwargs, ) -> Stream: stream_type = arg.delayed_acquire(stream_type, self._get_stream_type) item_type = self._get_item_type(stream_type) data = kwargs.pop('data', None) if not arg.is_defined(data): data = self._get_items_of_type(item_type, step=step, verbose=verbose) stream_kwargs = self.get_stream_kwargs(data=data, step=step, verbose=verbose, **kwargs) return stream_type.stream(**stream_kwargs)
def to_stream_type( self, stream_type: StreamType, step: AutoCount = AUTO, verbose: AutoBool = AUTO, message: Union[str, Auto, None] = AUTO, **kwargs, ) -> Stream: stream_type = Auto.delayed_acquire(stream_type, self._get_stream_type) item_type = self._get_item_type(stream_type) if item_type == ItemType.StructRow and hasattr( self, 'get_struct') and 'struct' not in kwargs: kwargs['struct'] = self.get_struct() data = kwargs.pop('data', None) if not Auto.is_defined(data): data = self._get_items_of_type(item_type, step=step, verbose=verbose, message=message) stream_kwargs = self.get_stream_kwargs(data=data, step=step, verbose=verbose, **kwargs) return stream_type.stream(**stream_kwargs)