Skip to content

feat(python): live pandas mesh node + interactive PandasExplorer frontend - #180

Merged
rbuergi merged 1 commit into
mainfrom
feat/python-pandas-node
Jul 2, 2026
Merged

rbuergi merged 1 commit into
mainfrom
feat/python-pandas-node

Conversation

@rbuergi

@rbuergi rbuergi commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

A genuinely interactive Python-mesh integration: a py/pandas participant holds a live pandas DataFrame as persistent in-process state (added a persistent namespace since CodeWorker discards state), controllable over the mesh via typed PandasCommand + code, rendered back as a real typed DataGridControl (byte-exact through the .NET serializer — no markdown/HTML). The PandasExplorer NodeType is the frontend: buttons + a text input each post a command to the participant and re-render the returned DataGrid — a proper frontend driving a live Python object — with a graceful no-node-attached state. Also makes language first-class in Code nodes (the language selector — the missing UI to author Python nodes). pytest 28/28, wire test 2/2, area tests 3/3, link-integrity green, Release -warnaserror clean.

🤖 Generated with Claude Code

…tend + language-first-class Code nodes

A Python participant (py/pandas) holds a live pandas DataFrame as persistent in-process
state (CodeWorker doesn't persist — added a persistent namespace so df survives calls),
controllable over the mesh via typed PandasCommand (load/append/groupby/rolling/describe/
reset) + SubmitCodeRequest, and renders it back as a real typed DataGridControl (byte-exact
through the .NET serializer — no markdown/HTML).

PandasExplorer NodeType: an interactive .NET layout area whose buttons + text input each
post a PandasCommand to py/pandas and re-render the returned DataGrid — a proper frontend
driving a live Python object. Graceful no-node-attached state (bounded, never hangs).

Code nodes: language selector in the Edit view (csharp/python/ts/js/json/sql/markdown) +
language-aware icons — the missing UI to author Python nodes (execution routing existed).

pytest 28/28, PandasDataGridWireTest 2/2, PandasExplorerAreaTest 3/3, link-integrity green,
Release -warnaserror clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an end-to-end “live pandas DataFrame over the mesh” sample, spanning a Python participant backend (py/pandas), a .NET NodeType frontend that drives it via mesh messages, and tests/docs to pin the wire contract (typed DataGridControl, not markdown/HTML). It also extends Code-node UX so Code nodes can be authored with an explicit language (incl. Python) and show language-aware glyphs in navigation.

Changes:

  • Introduces a Python meshweaver.examples.pandas_node participant that holds a persistent in-process pandas.DataFrame, supports typed commands + SubmitCodeRequest, and renders state as DataGridControl JSON.
  • Adds a .NET PandasExplorer NodeType + layout area that posts PandasCommands to py/pandas and renders the returned DataGridControl, with a no-participant degraded UI path.
  • Improves Code node authoring with a language selector + language-aware nav icons (C#/Py/JS/TS).

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/MeshWeaver.Layout.Test/PandasExplorerAreaTest.cs Adds layout-area integration tests for PandasExplorer (renders grid, posts groupby, no-participant notice).
test/MeshWeaver.Layout.Test/PandasDataGridWireTest.cs Pins the Python-emitted DataGrid JSON and validates it deserializes to typed DataGridControl/columns.
test/MeshWeaver.Layout.Test/MeshWeaver.Layout.Test.csproj Link-compiles PandasExplorer sample sources into tests to keep a single source of truth.
src/MeshWeaver.Graph/CodeLayoutAreas.cs Adds Code-node language options, reads sibling language for icons, and persists language from the editor UI.
src/MeshWeaver.Documentation/Data/DataMesh/PythonPandasNode.md New documentation page describing the pandas participant model + wire contract + frontend node.
src/MeshWeaver.Documentation/Data/DataMesh/NodeTypes.md Adds a link/entry for the new Python pandas node documentation.
src/MeshWeaver.Documentation/Data/DataMesh/CallingPython.md Adds a “Related” link to the stateful pandas participant doc.
src/MeshWeaver.Application.Styles/CustomIcons.cs Adds simple language glyph icons and a ForLanguage(...) mapper.
samples/Graph/Data/PythonDemo/PandasExplorer/Source/PandasExplorerLayoutAreas.cs Implements interactive PandasExplorer layout area (toolbar + reactive grid + graceful degradation).
samples/Graph/Data/PythonDemo/PandasExplorer/Source/PandasExplorer.cs Adds the PandasExplorer content record plus PandasCommand/view command models.
samples/Graph/Data/PythonDemo/PandasExplorer/LiveFrame.json Adds a persistent sample instance node driving the explorer.
samples/Graph/Data/PythonDemo/PandasExplorer.json Registers the PandasExplorer NodeType definition in samples.
clients/python/tests/test_pandas_node.py Adds pytest coverage for dtype→column mapping, mutation persistence, and code-surface persistence.
clients/python/scripts/gen_proto.sh Uses ${PYTHON:-python3} for protoc generation for portability.
clients/python/pyproject.toml Adds pandas to optional deps (examples/dev) for the new example participant.
clients/python/meshweaver/examples/pandas_node.py Implements the stateful pandas participant + command protocol + demo/serve entry points.
clients/python/meshweaver/examples/init.py Introduces the examples package and documents the pandas example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +477 to +485
var (currentCode, currentLanguage) = edited;
var chosenLanguage = string.IsNullOrWhiteSpace(currentLanguage)
? codeConfig.Language
: currentLanguage;
var updatedCodeConfiguration = codeConfig with
{
Code = currentCode,
Language = chosenLanguage!,
};
Comment on lines +178 to +182
host.GetDataStream<string>(GroupByColumnId)
.Take(1)
.Subscribe(column =>
View(host, PandasViewCommand.GroupBy(
string.IsNullOrWhiteSpace(column) ? DefaultGroupBy : column!.Trim())));
/// camelCase field names — exactly what <c>pandas_node.PandasNode._apply</c> reads off the message.
/// The participant answers grid commands with a <see cref="DataGridControl"/> and mutations with an ack.
/// </summary>
public record PandasCommand : IRequest<DataGridControl>
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

1 008 tests   - 106   1 008 ✅  - 104   3m 8s ⏱️ - 1m 7s
   14 suites ±  0       0 💤  -   1 
   14 files   ±  0       0 ❌  -   1 

Results for commit dcf4b93. ± Comparison against base commit 0cac4e7.

This pull request removes 125 and adds 19 tests. Note that renamed tests count towards both.
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveAgents_FromHostedSubHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveAgents_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveModels_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentSyncedQueryFromHostedHubTest ‑ HostedSubHub_GetQuery_AgentDropdownNamesAreNonEmpty
MeshWeaver.Hosting.Monolith.Test.AgentSyncedQueryFromHostedHubTest ‑ HostedSubHub_GetQuery_ReturnsAgentsAndModels
MeshWeaver.Hosting.Monolith.Test.CircuitContextIsolationTest ‑ CircuitContext_DoesNotLeakAnotherUserAcrossAnAsyncLocalHop
MeshWeaver.Hosting.Monolith.Test.CompileActivityLogTest ‑ FailedCompile_FaultsActivityAndSurfacesFullDiagnostics
MeshWeaver.Hosting.Monolith.Test.CompileActivityLogTest ‑ SuccessfulCompile_PopulatesCompiledSourcesSnapshot
MeshWeaver.Hosting.Monolith.Test.CompileActivityLogTest ‑ SuccessfulCompile_ReportsActivityLogWithSourceQueriesAndMatchedPaths
MeshWeaver.Hosting.Monolith.Test.CompileFinishAndDisposeTest ‑ FailedCompile_StillReachesTerminalDisposedState_NotStuck
…
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ CodeEdit_ExplicitRelease_IsUpToDate_RecompilesOnSourceChange
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ FailedCompile_PreservesErrorLogAndDoesNotCreateRelease
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ IsDirty_FlipsTrueOnSourceEdit_FalseAfterCompile
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ NodeType_RequestedReleasePath_PinsToHistoricalRelease
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ PressingCompileButton_SetsRequestedReleaseAt_AndProducesNewRelease
MeshWeaver.Hosting.Monolith.Test.ExportDocumentScriptRelayTest ‑ ExportRequest_StartsScriptActivity_AndReturnsBytesOnTerminal
MeshWeaver.Hosting.Monolith.Test.FrameworkStaleInstanceRenderTest ‑ FrameworkStaleInstance_RendersCompiledArea_NotOverlay
MeshWeaver.Hosting.Monolith.Test.ObserveQueryFreshnessTest ‑ ObserveQuery_AccessAssignment_AddedEventArrives_AfterCreateNode
MeshWeaver.Hosting.Monolith.Test.ObserveQueryFreshnessTest ‑ ObserveQuery_AccessAssignment_InitialIncludesPriorCreate
MeshWeaver.Hosting.Monolith.Test.ObserveQueryFreshnessTest ‑ ObserveQuery_AfterCreate_ReturnsTheJustCreatedNode
…

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

781 tests  ±0   674 ✅ ±0   2m 32s ⏱️ -1s
 12 suites ±0   107 💤 ±0 
 12 files   ±0     0 ❌ ±0 

Results for commit dcf4b93. ± Comparison against base commit 0cac4e7.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

   14 files  ±  0     14 suites  ±0   6m 39s ⏱️ -33s
1 121 tests  - 100  1 118 ✅  - 100  3 💤 ±0  0 ❌ ±0 
1 122 runs   - 105  1 119 ✅  - 105  3 💤 ±0  0 ❌ ±0 

Results for commit dcf4b93. ± Comparison against base commit 0cac4e7.

This pull request removes 101 and adds 1 tests. Note that renamed tests count towards both.
MeshWeaver.Persistence.Test.ConcurrentRequestsTest ‑ ConcurrentRequests_MultipleNodeTypes_AllLoadWithoutHanging
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.AgenticAI.md")
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.ChatCommands.md")
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.PlatformProviderS"···)
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.Architecture.ActionB"···)
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.Architecture.AddingA"···)
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.Architecture.Agentic"···)
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.Architecture.EmailIn"···)
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.Architecture.ErrorPr"···)
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.Architecture.Extensi"···)
…
MeshWeaver.Persistence.Test.UnregisteredNodeTypeTest ‑ UnknownNodeType_FailsFastNotAfterSlowPathTimeout

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

1 600 tests  +5   1 600 ✅ +5   5m 32s ⏱️ +12s
   13 suites ±0       0 💤 ±0 
   13 files   ±0       0 ❌ ±0 

Results for commit dcf4b93. ± Comparison against base commit 0cac4e7.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Test Results

   53 files  ±  0     53 suites  ±0   17m 53s ⏱️ - 1m 29s
4 510 tests  - 201  4 400 ✅  - 199  110 💤  - 1  0 ❌  - 1 
4 511 runs   - 206  4 401 ✅  - 204  110 💤  - 1  0 ❌  - 1 

Results for commit dcf4b93. ± Comparison against base commit 0cac4e7.

This pull request removes 226 and adds 25 tests. Note that renamed tests count towards both.
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveAgents_FromHostedSubHub_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveAgents_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentPickerProjectionPartitionedTest ‑ PartitionedPath_ObserveModels_PopulatesCombobox
MeshWeaver.Hosting.Monolith.Test.AgentSyncedQueryFromHostedHubTest ‑ HostedSubHub_GetQuery_AgentDropdownNamesAreNonEmpty
MeshWeaver.Hosting.Monolith.Test.AgentSyncedQueryFromHostedHubTest ‑ HostedSubHub_GetQuery_ReturnsAgentsAndModels
MeshWeaver.Hosting.Monolith.Test.CircuitContextIsolationTest ‑ CircuitContext_DoesNotLeakAnotherUserAcrossAnAsyncLocalHop
MeshWeaver.Hosting.Monolith.Test.CompileActivityLogTest ‑ FailedCompile_FaultsActivityAndSurfacesFullDiagnostics
MeshWeaver.Hosting.Monolith.Test.CompileActivityLogTest ‑ SuccessfulCompile_PopulatesCompiledSourcesSnapshot
MeshWeaver.Hosting.Monolith.Test.CompileActivityLogTest ‑ SuccessfulCompile_ReportsActivityLogWithSourceQueriesAndMatchedPaths
MeshWeaver.Hosting.Monolith.Test.CompileFinishAndDisposeTest ‑ FailedCompile_StillReachesTerminalDisposedState_NotStuck
…
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ CodeEdit_ExplicitRelease_IsUpToDate_RecompilesOnSourceChange
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ FailedCompile_PreservesErrorLogAndDoesNotCreateRelease
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ IsDirty_FlipsTrueOnSourceEdit_FalseAfterCompile
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ NodeType_RequestedReleasePath_PinsToHistoricalRelease
MeshWeaver.Hosting.Monolith.Test.CodeEditRecompileTest ‑ PressingCompileButton_SetsRequestedReleaseAt_AndProducesNewRelease
MeshWeaver.Hosting.Monolith.Test.ExportDocumentScriptRelayTest ‑ ExportRequest_StartsScriptActivity_AndReturnsBytesOnTerminal
MeshWeaver.Hosting.Monolith.Test.FrameworkStaleInstanceRenderTest ‑ FrameworkStaleInstance_RendersCompiledArea_NotOverlay
MeshWeaver.Hosting.Monolith.Test.ObserveQueryFreshnessTest ‑ ObserveQuery_AccessAssignment_AddedEventArrives_AfterCreateNode
MeshWeaver.Hosting.Monolith.Test.ObserveQueryFreshnessTest ‑ ObserveQuery_AccessAssignment_InitialIncludesPriorCreate
MeshWeaver.Hosting.Monolith.Test.ObserveQueryFreshnessTest ‑ ObserveQuery_AfterCreate_ReturnsTheJustCreatedNode
…

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.

2 participants