(
ndarray: np.ndarray, ctx: DataContext
)
| 779 | |
| 780 | |
| 781 | def ndarray_to_block( |
| 782 | ndarray: np.ndarray, ctx: DataContext |
| 783 | ) -> Tuple["Block", "BlockMetadataWithSchema"]: |
| 784 | from ray.data.block import BlockAccessor, BlockExecStats, BlockMetadataWithSchema |
| 785 | |
| 786 | DataContext._set_current(ctx) |
| 787 | |
| 788 | stats = BlockExecStats.builder() |
| 789 | block = BlockAccessor.batch_to_block({"data": ndarray}) |
| 790 | return block, BlockMetadataWithSchema.from_block( |
| 791 | block, block_exec_stats=stats.build() |
| 792 | ) |
| 793 | |
| 794 | |
| 795 | def get_table_block_metadata_schema( |
nothing calls this directly
no test coverage detected
searching dependent graphs…