pycarol.tools.dag

pycarol.tools.dag.find_keys(node, kv)[source]

Find recursively all the values from a given key.

Parameters
  • node (dict of dict) – Nested dictionary.

  • kv (str) – dictionary key to find.

Yields

dict – dictionary

pycarol.tools.dag.get_staging_prefix(carol, staging_prefix, connector_name, connector_id)[source]

Create the prefix for a given set of staging_prefix, connector_name, connector_id

Parameters
  • carolpycarol.Carol Carol() object.

  • connector_namestr Connector Name

  • prefix – ‘str` default DM_ prefix to add to the data model name. e.g., if dm_name=’mydatamoldel’, the result will be “DM_mydatamoldel`. This is only applied for DataModel.

  • staging_prefix

    ‘str` default None Prefix for the staging name. e.g., if staging_prefix=’connector_name` the output will be:

    { “connector_name_stag3” : {“connector_name_stag1”, “connector_name_stag2”}}

    Possible values are: ‘connector_name’, ‘connector_id’, None

pycarol.tools.dag.unroll_list(l)[source]

Unroll a list of lists to a flat list

Parameters

l (list of lists) – List of list to unroll

Yields

list – unrolled list.