ob-metaflow-stubs provides type stubs for the Metaflow library, enhancing static analysis and developer experience for Metaflow users. Metaflow is a human-centric framework for building and managing real-life AI and ML systems, originally developed at Netflix and now supported by Outerbounds. It streamlines the entire development lifecycle from rapid prototyping to production deployments, enabling teams to iterate quickly and deliver robust systems efficiently. The library is actively maintained with frequent patch releases, aligning with the core Metaflow project's release cadence.
pip install ob-metaflow-stubsVerified import paths — ran on the pinned version, not inferred.
This 'Hello World' example defines a basic Metaflow flow with three steps: `start`, `hello`, and `end`. It demonstrates defining steps with `@step` and connecting them with `self.next()`. Run this script using `python your_flow_name.py run` in your terminal to execute the flow locally.
Always review the GitHub release notes of the main `metaflow` library (Netflix/metaflow) before upgrading to understand specific breaking changes and migration steps that might affect stub usage.
Explicitly declare all external Python dependencies using the `@pypi` or `@conda` decorators on your `FlowSpec` class or individual `@step` methods to ensure reproducibility and correct execution in remote environments. For example: `@pypi(packages={'scikit-learn': '1.0.2'})`.Install and configure Windows Subsystem for Linux (WSL) and then install Metaflow (and its stubs) within the WSL environment.
Avoid mutable default arguments. Initialize mutable objects (like lists or dictionaries) inside the step method, for example, `items = [] if items is None else items`.
Always ensure that `self.next(next_step_method)` is called at the end of every step (except for the final `end` step) to define the flow's execution graph.