maaz.code logo
Simple view

Mergedholoviz/datashader#15383.6Kstars

docs: Fix the Dask snippets in the Performance user guide

By Mohd Maaz Khan, merged by hoxbro into holoviz/datashader on 14 Oct 2026

+2−22 lines added, 2 lines removed1 file changed1 comment

Conversation

  1. maaz7409opened this pull request on 13 Oct 2026description.mdAuthor

    Description

    This PR fixes two code snippets in the markdown cells of the Performance user guide.

    SectionBeforeAfterReason for change
    File formatsdd.to_parquet(filename, df, compression="SNAPPY")dd.to_parquet(df, filename, compression="SNAPPY")The signature is to_parquet(df, path, ...). The reversed order raises AttributeError: 'str' object has no attribute '_meta'.
    Using Dask efficientlydask_df.persist()dask_df = dask_df.persist()persist() returns a new collection and does not modify dask_df in place, so as written the data is never persisted, which is the point of the paragraph.

    Ran both snippets before and after the fix (dask 2026.8.0, pandas 3.0.6):

    • to_parquet: the old order raises the AttributeError above; the new order writes the file, it reads back identical, and the parquet metadata shows SNAPPY compression
    • persist: after dask_df.persist(), dask_df is still the unpersisted FromPandas graph and the persisted result (FromGraph) is discarded; after dask_df = dask_df.persist(), cvs.points(dask_df, 'x', 'y') aggregates all rows

    AI Disclosure

    Tool & Model: Claude Code ( Claude Opus 5.5 (high) ) Usage: It reviewed and audited docs, and flagged these issues.

    • I have tested all AI-generated content in my PR.
    • I take responsibility for all AI-generated content in my PR.

    Checklist

    • pre-commit run --files on the notebook: passed (typos, clean-notebook, whitespace)
  2. hoxbrocommented on 14 Oct 2026Member

    Thank you.

  3. hoxbromerged this pull request on 14 Oct 2026

Copied from GitHub when this site was built; comments by bots are left out.