randonneur.nodes

Attributes

verb_dispatch

Functions

migrate_nodes(→ List[dict])

For each node in graph, check each transformation in migrations. For each

migrate_nodes_with_stored_data(→ List[dict])

A simple wrapper to load from a randonneur_data.Registry with some basic sanity checks.

Module Contents

randonneur.nodes.migrate_nodes(graph: List[dict], migrations: dict, config: randonneur.config.MigrationConfig | None = None) List[dict][source]

For each node in graph, check each transformation in migrations. For each transformation for which there is a match, make the given changes to the node.

Here is an example:

```python migrate_nodes(

graph=[{“name”: “foo”}], migrations={“update”: [{“source”: {“name”: “foo”}, “target”: {“location”: “bar”}}]},

) >>> [{“name”: “foo”, “location”: “bar”}] ```

The changes can be customized with a MigrationConfig object. See the MigrationConfig docs for information on its input arguments.

Changes graph in place, and returns graph with altered content.

randonneur.nodes.migrate_nodes_with_stored_data(graph: List[dict], label: str, data_registry_path: pathlib.Path | None = None, config: randonneur.config.MigrationConfig | None = None) List[dict][source]

A simple wrapper to load from a randonneur_data.Registry with some basic sanity checks.

randonneur.nodes.verb_dispatch[source]