mltrace package

Module contents

mltrace.add_notes_to_component_run(component_run_id: str, notes: str)str[source]

Adds notes to component run.

mltrace.backtrace(output_pointer: str)[source]

Prints trace for an output id. Returns list of tuples (level, ComponentRun) where level is how many hops away the node is from the node that produced the output_id.

mltrace.clean_db()[source]

Deletes database and reinitializes tables.

mltrace.create_component(name: str, description: str, owner: str, tags: List[str] = [])[source]

Creates a component entity in the database.

mltrace.create_random_ids(num_outputs=1)List[str][source]

Returns a list of num_outputs ids that a client can use to tag outputs.

mltrace.flag_output_id(output_id: str)bool[source]

Sets the flag property of an IOPointer to true.

mltrace.get_component_information(component_name: str)mltrace.entities.component.Component[source]

Returns a Component with the name, info, owner, and tags.

mltrace.get_component_run_information(component_run_id: str)mltrace.entities.component_run.ComponentRun[source]

Returns a ComponentRun object.

mltrace.get_components_with_owner(owner: str)List[mltrace.entities.component.Component][source]

Returns a list of all the components associated with the specified order.

mltrace.get_components_with_tag(tag: str)List[mltrace.entities.component.Component][source]

Returns a list of components with the specified tag.

mltrace.get_db_uri()str[source]
mltrace.get_git_hash()str[source]

Gets hash of the parent git repo.

mltrace.get_git_tags()str[source]

Gets tags associated with commit of parent git repo, if exists ref:https://stackoverflow.com/questions/34932306/get-tags-of-a-commit

mltrace.get_history(component_name: str, limit: int = 10, date_lower: Union[datetime.datetime, str] = datetime.datetime(1, 1, 1, 0, 0), date_upper: Union[datetime.datetime, str] = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999))List[mltrace.entities.component_run.ComponentRun][source]

Returns a list of ComponentRuns that are part of the component’s history.

mltrace.get_io_pointer(io_pointer_id: str, create=True)[source]

Returns IO Pointer metadata.

mltrace.get_recent_run_ids(limit: int = 5, last_run_id=None)[source]

Returns most recent component run ids.

mltrace.log_component_run(component_run: mltrace.entities.component_run.ComponentRun, set_dependencies_from_inputs=True, staleness_threshold: int = 2592000)[source]

Takes client-facing ComponentRun object and logs it to the DB.

mltrace.register(component_name: str, inputs: List[str] = [], outputs: List[str] = [], input_vars: List[str] = [], output_vars: List[str] = [], endpoint: bool = False, staleness_threshold: int = 2592000)[source]
mltrace.review_flagged_outputs()[source]

Finds common ComponentRuns for a group of flagged outputs. Returns a list of ComponentRuns and occurrence counts in the group of flagged outputs, sorted by descending count and then alphabetically.

mltrace.set_address(address: str)[source]
mltrace.set_db_uri(uri: str)[source]
mltrace.tag_component(component_name: str, tags: List[str])[source]

Adds tags to existing component.

mltrace.unflag_output_id(output_id: str)bool[source]

Sets the flag property of an IOPointer to false.

mltrace.web_trace(output_id: str)[source]