MCPcopy
hub / github.com/pathwaycom/pathway / table_from_markdown

Function table_from_markdown

python/pathway/debug/__init__.py:446–472  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

444
445
446def 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

Callers 15

TFunction · 0.90
test_from_timestamp_nsFunction · 0.90
test_from_timestamp_usFunction · 0.90
test_from_timestamp_msFunction · 0.90
test_from_timestamp_sFunction · 0.90
test_pathway_durationFunction · 0.90

Calls 2

_markdown_to_pandasFunction · 0.85
table_from_pandasFunction · 0.85