Skip to content

Claude/fix stub generation y mpbt#445

Open
Edwardvaneechoud wants to merge 2 commits intomainfrom
claude/fix-stub-generation-yMpbt
Open

Claude/fix stub generation y mpbt#445
Edwardvaneechoud wants to merge 2 commits intomainfrom
claude/fix-stub-generation-yMpbt

Conversation

@Edwardvaneechoud
Copy link
Copy Markdown
Owner

@Edwardvaneechoud Edwardvaneechoud commented May 4, 2026

This pull request introduces a new utility for programmatically saving flows to the catalog, improves namespace management for Python-authored flows, and makes several code quality and documentation updates. The most significant change is the addition of the save_flow_to_catalog function, which allows users to register flows from Python code, aligning with the canvas "Save to Catalog" feature. Additionally, the new "Python Flows" namespace is introduced to better organize flows created programmatically.

Key changes include:

New Python Flows Namespace and Catalog Registration:

  • Added ensure_python_flows_namespace methods to both CatalogService and its flows service, enabling creation and resolution of the "General > Python Flows" namespace for programmatically authored flows. [1] [2]
  • Introduced the save_flow_to_catalog function in flowfile_frame/catalog.py, which saves a flow to disk and registers it in the catalog, defaulting to the "Python Flows" namespace. This includes validation for flow names and checks for namespace and file collisions.
  • Updated __init__.py and __init__.pyi to expose save_flow_to_catalog and related schema types (OutputFieldConfig, OutputFieldInfo) at the top level of the flowfile_frame package for easier user access. [1] [2] [3]

Documentation and Error Message Improvements:

  • Enhanced documentation for write_catalog_table to clarify the new 'virtual' write mode and its requirements, including the need for prior catalog registration via save_flow_to_catalog.
  • Improved error messages in virtual table creation to guide users toward the new registration workflow.

Code Quality and Minor Refactoring:

  • Refactored several code generation methods for clarity and conciseness, including line unwrapping and minor logic cleanups in code_generator.py. [1] [2] [3] [4] [5] [6]
  • Added an internal _emit_output_validation method to support output schema validation during code generation.
  • Added missing imports and a regex for validating flow names in catalog.py. [1] [2]

claude added 2 commits May 1, 2026 15:02
Four targeted improvements to make canvas-authored flows feel native when
rebuilt in Python via flowfile_frame:

1. Add "virtual" to WriteMode TypeAlias and FlowFrame.write_catalog_table
   Literal so IDE/type-checker accepts write_mode="virtual".

2. Add save_flow_to_catalog free function and FlowFrame.save_to_catalog
   method to register a Python-authored flow (default landing namespace:
   General > Python Flows, auto-created on first use). Improves the
   virtual-write error message with a copy-pastable hint.

3. Translate flowfile_formulas in with_columns to a single polars-code
   node via polars_expr_transformer.to_polars_code when all formulas
   convert; fall back per-formula otherwise (all-or-nothing).

4. Plumb output_field_config through read_from_cloud_storage and the four
   scan_*_from_cloud_storage helpers; add FlowFrame.with_output_validation
   for ergonomic per-step validation; emit .with_output_validation(...)
   from the flowframe code-generator so canvas validation round-trips.

Also bump polars-expr-transformer to >=0.5.4.

https://claude.ai/code/session_01KFY9WBmRT6jNhEbUMxgeKu
Sync .pyi stubs with current source after recent API additions
(save_flow_to_catalog, save_to_catalog, with_output_validation,
output_field_config kwargs, virtual write mode, etc.) so
'make check_stubs' passes in CI.

https://claude.ai/code/session_01D28WP4tn1HL67GNVgJGGnD
@netlify
Copy link
Copy Markdown

netlify Bot commented May 4, 2026

Deploy Preview for flowfile-wasm canceled.

Name Link
🔨 Latest commit 38780d0
🔍 Latest deploy log https://app.netlify.com/projects/flowfile-wasm/deploys/69f8c21fccd20f00082617b5

@Edwardvaneechoud Edwardvaneechoud marked this pull request as ready for review May 4, 2026 17:13
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