pathwaycom/pathway · error · TypeError

not supported type of debug data

Error message

not supported type of debug data

What it means

pw.debug.table_from_markdown / debug_datasource accepts only None or a pandas DataFrame as inline debug data. Passing any other type (list of tuples, dict, markdown string, csv string) raises TypeError at graph-build time, because only the pandas path is implemented.

Source

Thrown at python/pathway/internals/datasource.py:135

class ImportDataSource(DataSource):
    callback: Callable[[api.Scope], api.ExportedTable]

    def is_bounded(self) -> bool:
        return False

    def is_append_only(self) -> bool:
        return False


def debug_datasource(debug_data) -> StaticDataSource | None:
    if debug_data is None:
        return None
    elif isinstance(debug_data, pd.DataFrame):
        return PandasDataSource(
            data=debug_data.copy(), schema=schema_from_pandas(debug_data)
        )
    else:
        raise TypeError("not supported type of debug data")


@dataclass(frozen=True)
class ErrorLogDataSource(DataSource):
    def is_bounded(self) -> bool:
        return False

    def is_append_only(self) -> bool:
        return True

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Convert your data to a pandas DataFrame first: pd.DataFrame(rows, columns=[...]).
  2. Use the intended debug helpers for markdown: pw.debug.table_from_markdown('''a\nb''') rather than passing through lower-level APIs.
  3. Pass None explicitly when no debug data is wanted.

Example fix

# before
rows = [("a", 1), ("b", 2)]
t = pw.debug.table_from_rows_like_debug(rows)  # wrong type reaches debug_datasource

# after
import pandas as pd
df = pd.DataFrame(rows, columns=["name", "val"])
t = pw.debug.table_from_pandas(df)
Defensive patterns

Strategy: type-guard

Validate before calling

import pandas as pd
assert debug_data is None or isinstance(debug_data, pd.DataFrame), 'debug data must be None or a pandas DataFrame'

Type guard

import pandas as pd

def debug_data_valid(d) -> bool:
    return d is None or isinstance(d, pd.DataFrame)

Prevention

When it happens

Trigger: pw.debug.table_from_markdown("a|b\n1|2") misused through APIs that route to debug_datasource with a raw string or list; internal calls in pw.debug helpers when given a non-DataFrame, non-None payload.

Common situations: Using pw.debug functions with non-pandas inputs; library-level code calling table_from_markdown/debug from dict or list data in newer versions where routing changed.

Related errors


AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15). Data as JSON: /api/errors/b6a103aaa340a6bb. Report an issue: GitHub.