randonneur.edges
Attributes
Functions
|
For each edge in each node in |
|
A simple wrapper to load from a randonneur_data.Registry with some basic sanity checks. |
Module Contents
- randonneur.edges.migrate_edges(graph: List[dict], migrations: dict, config: randonneur.config.MigrationConfig | None = None) List[dict][source]
For each edge in each node in
graph, check each transformation inmigrations. For each transformation for which there is a match, make the given changes to the edge.Here is an example:
graph=[{“edges”: [{“name”: “foo”}]}], migrations={“update”: [{“source”: {“name”: “foo”}, “target”: {“location”: “bar”}}]},
) >>> [{“edges”: [{“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.edges.migrate_edges_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.