Skip to content

Render DataFrames as interactive notebook tables - #94

Draft
eosfor wants to merge 4 commits into
DataficationSDK:mainfrom
eosfor:pr/dataframe-formatter-extension
Draft

Render DataFrames as interactive notebook tables#94
eosfor wants to merge 4 commits into
DataficationSDK:mainfrom
eosfor:pr/dataframe-formatter-extension

Conversation

@eosfor

@eosfor eosfor commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Important

This PR is stacked on #93 and should be reviewed after it. Because the head branches live in a fork, GitHub cannot use the first PR's fork branch as the base of an upstream PR. Until #93 is merged, this diff also contains its two commits. The DataFrame-specific commits are f7b8b84 and a4eb66b.

Summary

  • add a packaged Verso.DataFrame extension for Microsoft.Data.Analysis.DataFrame values
  • render DataFrames as theme-aware, scrollable HTML tables with column names and types, sticky headers, null styling, HTML encoding, and a bounded 100-row preview
  • recognize DataFrames and unwrap PowerShell PSObject values through reflection
  • integrate the formatter into the CLI, Blazor editor, and VS Code host
  • add unit tests plus built-in extension discovery coverage
  • document DataFrame table support and its place in the execution pipeline

Why

PowerShell data-analysis modules can expose Microsoft.Data.Analysis.DataFrame, but the default output only reveals the object's Columns and Rows properties. A notebook needs a readable table while preserving extension isolation from the language kernel that owns the runtime assembly.

The extension deliberately has no compile-time dependency on Microsoft.Data.Analysis. It recognizes and reads the public DataFrame shape through reflection, avoiding type-identity conflicts when PowerShell loads a different version or load context.

User impact

Both implicit PowerShell output and explicit display now produce the same table:

Import-Module DataFrame
$penguins = Import-DataFrame ./data/penguins.csv

$penguins
Display $penguins

Manual validation used the Palmer Penguins dataset: 344 rows and 8 columns, with the preview correctly reporting Showing 100 of 344 rows.

Validation

  • dotnet test Verso.sln --no-restore
  • Verso.DataFrame.Tests: 11 passed
  • CLI discovery reports verso.dataframe.formatter
  • package inspection confirms that Verso.DataFrame has no Microsoft.Data.Analysis dependency
  • manually verified implicit output and Display $penguins using the PowerShell DataFrame module

The full solution test suite passes. Existing dependency-analysis and documentation warnings are unchanged.

eosfor added 4 commits July 31, 2026 21:14
Add a specialized formatter hook to execution contexts, distinguish generic fallback formatters, and centralize formatter resolution for both explicit Display calls and language kernels. Document the extension contract and cover priority, fallback, and failure behavior with tests.

Signed-off-by: eosfor <9363027+eosfor@users.noreply.github.com>
Preserve raw PSObject results until the kernel can offer each runtime value to specialized IDataFormatter extensions. Batch contiguous unhandled objects through the existing PowerShell ETS renderer so native table formatting and mixed-output ordering remain intact.

Signed-off-by: eosfor <9363027+eosfor@users.noreply.github.com>
Signed-off-by: eosfor <9363027+eosfor@users.noreply.github.com>
Signed-off-by: eosfor <9363027+eosfor@users.noreply.github.com>
@eosfor
eosfor force-pushed the pr/dataframe-formatter-extension branch from 833cec5 to a4eb66b Compare August 1, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant