Skip to content

Commit

Permalink
Add docstring about need for include_indicator_columns=True (#8528)
Browse files Browse the repository at this point in the history
### Related
- #8522

### What
Explains how to avoid hitting an issue.
  • Loading branch information
jleibs authored Dec 18, 2024
1 parent fd1adf9 commit 5b62c37
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions rerun_py/rerun_sdk/rerun/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ def as_arrow_array(self) -> pa.Array:


def send_record_batch(batch: pa.RecordBatch, rec: Optional[RecordingStream] = None) -> None:
"""Coerce a single pyarrow `RecordBatch` to Rerun structure."""
"""
Coerce a single pyarrow `RecordBatch` to Rerun structure.
If this `RecordBatch` came from a call to [`RecordingView.view`][rerun.dataframe.RecordingView.view], you
will want to make sure the `view` call includes `include_indicator_columns = True` or else the
viewer will not know about the archetypes in the data.
"""

indexes = []
data: defaultdict[str, list[Any]] = defaultdict(list)
Expand Down Expand Up @@ -112,7 +118,14 @@ def send_record_batch(batch: pa.RecordBatch, rec: Optional[RecordingStream] = No


def send_dataframe(df: pa.RecordBatchReader | pa.Table, rec: Optional[RecordingStream] = None) -> None:
"""Coerce a pyarrow `RecordBatchReader` or `Table` to Rerun structure."""
"""
Coerce a pyarrow `RecordBatchReader` or `Table` to Rerun structure.
If this `Table` came from a call to [`RecordingView.view`][rerun.dataframe.RecordingView.view], you
will want to make sure the `view` call includes `include_indicator_columns = True` or else the
viewer will not know about the archetypes in the data.
"""
if isinstance(df, pa.Table):
df = df.to_reader()

Expand Down

0 comments on commit 5b62c37

Please sign in to comment.