A function for creating a table from its definition in markdown. If it contains a special column ``__time__``, rows will be split into batches with timestamps from the column. A special column ``__diff__`` can be used to set an event type - with ``1`` treated as inserting the row and ``-
(
table_def,
id_from=None,
unsafe_trusted_ids=False,
schema: type[Schema] | None = None,
*,
_stacklevel: int = 1,
split_on_whitespace: bool = True,
_new_universe: bool = False,
)
| 444 | |
| 445 | |
| 446 | def table_from_markdown( |
| 447 | table_def, |
| 448 | id_from=None, |
| 449 | unsafe_trusted_ids=False, |
| 450 | schema: type[Schema] | None = None, |
| 451 | *, |
| 452 | _stacklevel: int = 1, |
| 453 | split_on_whitespace: bool = True, |
| 454 | _new_universe: bool = False, |
| 455 | ) -> Table: |
| 456 | """A function for creating a table from its definition in markdown. If it contains a special |
| 457 | column ``__time__``, rows will be split into batches with timestamps from the column. |
| 458 | A special column ``__diff__`` can be used to set an event type - with ``1`` treated |
| 459 | as inserting the row and ``-1`` as removing it. |
| 460 | |
| 461 | By default, it splits on whitespaces. To get a table containing |
| 462 | strings with whitespaces, use with ``split_on_whitespace = False``. |
| 463 | """ |
| 464 | df = _markdown_to_pandas(table_def, split_on_whitespace) |
| 465 | return table_from_pandas( |
| 466 | df, |
| 467 | id_from=id_from, |
| 468 | unsafe_trusted_ids=unsafe_trusted_ids, |
| 469 | schema=schema, |
| 470 | _stacklevel=_stacklevel + 1, |
| 471 | _new_universe=_new_universe, |
| 472 | ) |
| 473 | |
| 474 | |
| 475 | @check_arg_types |