There is no public method on DJClient for deploying local spec files to a branch namespace. The local development loop (edit specs, push to branch, validate, iterate) currently has no programmatic Python API, only a CLI path. This makes it impossible to drive the dev loop from notebooks, scripts, or CI without shelling out.
To support this, we can add a public push() method to DJ client:
def push(self, namespace: str, spec_path: str) -> list[dict]:
"""
Deploy local node specs to a branch namespace.
Reads YAML spec files from spec_path and deploys them to the given namespace.
The namespace must not be git_only (use sync_namespace_from_git for protected
namespaces).
Args:
namespace: Full branch namespace name, e.g. "myproject.feature_x"
spec_path: Path to a directory of YAML spec files or a single YAML file
Returns:
List of DeploymentResult dicts
"""
Note that this method is intended for branch namespaces only, and attempting to push to a git-only namespace will be rejected by the server (#1966) with a descriptive error
The spec format should match what the dj push CLI already produces, and spec_path is the directory (all .yaml/.yml files) with the nodes for this namespace.
dj.push("myproject.feature_x", "./nodes/") deploys all specs in the directory to that namespace
Attempting to push to a git-only namespace surfaces the server's 403 as a DJClientException
There is no public method on DJClient for deploying local spec files to a branch namespace. The local development loop (edit specs, push to branch, validate, iterate) currently has no programmatic Python API, only a CLI path. This makes it impossible to drive the dev loop from notebooks, scripts, or CI without shelling out.
To support this, we can add a public
push()method to DJ client:Note that this method is intended for branch namespaces only, and attempting to push to a git-only namespace will be rejected by the server (#1966) with a descriptive error
The spec format should match what the
dj pushCLI already produces, andspec_pathis the directory (all.yaml/.ymlfiles) with the nodes for this namespace.dj.push("myproject.feature_x", "./nodes/")deploys all specs in the directory to that namespaceAttempting to push to a git-only namespace surfaces the server's 403 as a
DJClientException