A function for creating a table from its definition in markdown. If it contains a column ``_time``, rows will be split into batches with timestamps from ``_time`` column. Then ``_worker`` column will be interpreted as the id of a worker which will process the row and ``_diff`
(
self,
table: str,
id_from: list[str] | None = None,
unsafe_trusted_ids: bool = False,
schema: type[Schema] | None = None,
_stacklevel: int = 1,
)
| 696 | return self._table_from_dict(batches, schema, _stacklevel=_stacklevel + 1) |
| 697 | |
| 698 | def table_from_markdown( |
| 699 | self, |
| 700 | table: str, |
| 701 | id_from: list[str] | None = None, |
| 702 | unsafe_trusted_ids: bool = False, |
| 703 | schema: type[Schema] | None = None, |
| 704 | _stacklevel: int = 1, |
| 705 | ) -> Table: |
| 706 | """A function for creating a table from its definition in markdown. If it |
| 707 | contains a column ``_time``, rows will be split into batches with timestamps from ``_time`` column. |
| 708 | Then ``_worker`` column will be interpreted as the id of a worker which will process the row and |
| 709 | ``_diff`` column as an event type - with ``1`` treated as inserting row and ``-1`` as removing. |
| 710 | """ |
| 711 | df = _markdown_to_pandas(table) |
| 712 | return self.table_from_pandas( |
| 713 | df, id_from, unsafe_trusted_ids, schema, _stacklevel=_stacklevel + 1 |
| 714 | ) |
| 715 | |
| 716 | def persistence_config(self) -> persistence.Config | None: |
| 717 | """Returns a persistece config to be used during run. Needs to be passed to ``pw.run`` |