User Defined Functions

analyze.udf.add_label(project_id, udf_id, label, branch='master')

Sets a label on a udf

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • label (str) – The label unique name

  • branch (str) – Project branch

Returns

list of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

list

analyze.udf.add_path(project_id, udf_id, path, branch='master')

Adds a table reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • path (str) – Object rollup path using unix style forward slashes branch (str): Project branch

Returns

None

analyze.udf.add_paths(project_id, additions, branch='master')

Adds multiple udf reference paths in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • additions (list) – List of moves, containing: udf_id (str): Unique udf identifier to_path (str): New path

  • branch (str) – Project branch

Returns

None

analyze.udf.copy(project_id, udf_id, rollup_id, after_position, branch='master')

Copies a udf

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • rollup_id (str) – Unique rollup identifier

  • after_position (int) – Position within the object rollup the object should be placed after

  • branch (str) – Project branch

Returns

result dict with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

dict

analyze.udf.copy_directory(project_id, from_path, to_path, branch='master')

Copies a folder and all paths in the hierarchy but does not duplicate referenced objects

Parameters
  • project_id (str) – Unique project identifier

  • from_path (str) – Original directory path

  • to_path (str) – Destination directory path

  • branch (str) – Project branch

Returns

None

analyze.udf.create(project_id, branch, path, name, id=None, memo=None, extension='py', view_manager=False, view_explorer=False, file_path=None)

Creates a udf

Parameters
  • project_id (str) – Unique project identifier

  • branch (str) – Project branch

  • path (str) – Path to place udf in hierarchy

  • name (str) – The object name

  • id (str) – Canonical ID for UDF. Must be lowercase letters, numbers, -, or _

  • memo (str) – The object description

  • extension (str) – The udf code syntax type

  • view_manager (bool) – UDF is visible to Manager roles if True

  • view_explorer (bool) – UDF is visible to Explorer roles if True

  • file_path (str) – Path to UDF code in project repo. Defaults to <name>.<extension>

Returns

result dict with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

dict

analyze.udf.create_directory(project_id, path, branch='master')

Creates a folder in the table hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Path to directory

  • branch (str) – Project branch

Returns

None

analyze.udf.delete(project_id, udf_id, branch='master')

Deletes a udf

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • branch (str) – Project branch

Returns

None

analyze.udf.delete_directory(project_id, path, branch='master')

Deletes a folder and removes path from all objects in that directory

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Path to directory

  • branch (str) – Project branch

Returns

None

analyze.udf.get_code(project_id, udf_id, branch='master')

Gets the code for the UDF

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • branch (str) – Project branch

Returns

User Defined Function code

Return type

str

analyze.udf.ids_from_path(project_id, path, branch='master')

Provides the cannonical id for the from a provided path

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Object rollup path using unix style forward slashes

  • branch (str) – Project branch

Returns

Unique udf ID on the specified path

Return type

str

analyze.udf.labels(project_id, udf_id, branch='master')

Provides a list of labels for the udf

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • branch (str) – Project branch

Returns

list of labels associated with UDF

Return type

list

analyze.udf.lookup_by_full_path(project_id, path, branch='master')

Returns ID for path provided

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Object rollup path using unix style forward slashes

  • branch (str) – Project branch

Returns

UDF unique identifier

Return type

str

analyze.udf.lookup_by_name(project_id, name, branch='master')

Returns ID for path provided

Parameters
  • project_id (str) – Unique project identifier

  • name (str) – Unique UDF name

  • branch (str) – Project branch

Returns

UDF unique identifier

Return type

str

analyze.udf.move(project_id, udf_id, rollup_id, after_position, branch='master')

Deletes a workflow udf

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • rollup_id (str) – Unique rollup identifier

  • after_position (int) – Position within the object rollup the object should be placed after

  • branch (str) – Project branch

Returns

None

analyze.udf.move_directory(project_id, from_path, to_path, branch='master')

Updates a folder name in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • from_path (str) – Original directory path

  • to_path (str) – Destination directory path

  • branch (str) – Project branch

Returns

None

analyze.udf.move_path(project_id, udf_id, from_path, to_path, branch='master')

Moves a table reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • from_path (str) – Original path

  • to_path (str) – Destination path

  • branch (str) – Project branch

Returns

None

analyze.udf.move_paths(project_id, moves, branch='master')

Moves a udf reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • moves (list) – List of move dicts with the following keys: - udf_id (str): Unique udf identifier - from_path (str): Original path - to_path (str): Destination path

  • branch (str) – Project branch

Returns

None

analyze.udf.paths(project_id, branch='master', path=None)

Provides a list of paths for all udfs in the project

Parameters
  • project_id (str) – Unique project identifier

  • branch (str) – Project branch

  • path (str) – Initial path to search

Returns

List of Dicts consisting of:
  • path (str): UDF leaf or branch path

  • type (str): leaf or branch to indicate the path type

  • id (str): For leaf type paths, the object the path points to

Return type

list

analyze.udf.paths_from_id(project_id, udf_id, branch='master')

Provides a list of paths associated with the cannonical id

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • branch (str) – Project branch

Returns

List of paths associated with a UDF ID

Return type

list

analyze.udf.remove_label(project_id, udf_id, label, branch='master')

Removes a label on a udf

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • label (str) – The label unique name

  • branch (str) – Project branch

Returns

list of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

list

analyze.udf.remove_path(project_id, udf_id, path, branch='master')

Removes a table reference path in the hierarchy

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • path (str) – Object rollup path using unix style forward slashes branch (str): Project branch

Returns

None

analyze.udf.search_by_label(project_id, text, criteria='contains', branch='master', sort=None, keys=None)

Returns list of udfs that match the search criteria

Parameters
  • project_id (str) – Unique project identifier

  • text (str) – The search text to locate

  • criteria (str) – The search criteria (contains, exact, startswith, or endswith)

  • branch (str) – Project branch

  • sort (list) – List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)]

  • keys (list) – List of keys to return. Defaults to all.

Returns

list of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

list

analyze.udf.search_by_name(project_id, text, criteria='contains', path='/', branch='master', sort=None, keys=None)

Returns list of udfs that match the search criteria

Parameters
  • project_id (str) – Unique project identifier

  • text (str) – The search text to locate

  • criteria (str) – The search criteria (contains, exact, startswith, or endswith)

  • path (str) – Path to search below for matches

  • branch (str) – Project branch

  • sort (list) – List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)]

  • keys (list) – List of keys to return. Defaults to all.

Returns

list of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

list

analyze.udf.set_code(project_id, udf_id, code, branch='master', message='')

Sets the code for the UDF

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • code (str) – User Defined Function code

  • branch (str) – Project branch

  • message (str) – Code commit message

Returns

None

analyze.udf.udf(project_id, udf_id, branch='master', keys=None)

Provides detailed udf information

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • branch (str) – Project branch

  • keys (list, optional) – List of keys to return. Defaults to all.

Returns

result dict with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

dict

analyze.udf.udfs(project_id, branch='master', id_filter=None, sort=None, keys=None, member_details=False)

Provides list of udfs in specified project

Parameters
  • project_id (str) – Unique project identifier

  • branch (str) – Project branch

  • id_filter (list, optional) – List or tuple of object unique identifiers to which to limit the results

  • sort (list, optional) – List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)]

  • keys (list, optional) – List of keys to return. Defaults to all.

  • member_details (bool, optional) – If True then returns member info relating to updated_by

Returns

result tuple of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

If member_details is set to True, the dict will also contain:
  • updated_by_full_name (str): The User Name of the user that last updated the project

  • updated_by_user_id (int): The id of the user that last updated the project

  • updated_by_gravatar_hash (str): Unique hash to pull gravatar for the user.

Return type

list

analyze.udf.udfs_from_label(project_id, label, branch='master', sort=None, keys=None)

Provides list of udfs for based on set of labels. Uses AND condition.

Parameters
  • project_id (str) – Unique project identifier

  • label (str) – label name

  • branch (str) – Project branch

  • sort (list) – List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)]

  • keys (list) – List of keys to return. Defaults to all.

Returns

list of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

list

analyze.udf.udfs_from_path(project_id, path, branch='master', sort=None, keys=None)

Provides list of udfs based on a path fragment. Path fragment can be to parent level.

Parameters
  • project_id (str) – Unique project identifier

  • path (str) – Object rollup path using unix style forward slashes

  • branch (str, optional) – Project branch

  • sort (list, optional) – List of sort tuples using syntax (key, reverse). e.g. [(‘name’, False)]

  • keys (list, optional) – List of keys to return. Defaults to all.

Returns

list of dicts with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

list

analyze.udf.update(project_id, udf_id, branch='master', **kwargs)

Updates a udf

Parameters
  • project_id (str) – Unique project identifier

  • udf_id (str) – Unique udf identifier

  • branch (str) – Project branch

Kwargs:
  • name (str): The object name

  • memo (str): The object description

  • extension (str): The udf code syntax type

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • file_path (str): Path to UDF code in project repo

Returns

result dict with the following properties
  • project_id (str): Unique project identifier

  • id (str): Unique udf identifier

  • branch (str): Project branch

  • name (str): UDF name

  • memo (str): UDF description

  • paths (list): List of paths assigned to udf

  • file_path (str): Path to UDF code in project repo

  • labels (list): List of labels assigned to udf

  • view_manager (bool): UDF is visible to Manager roles if True

  • view_explorer (bool): UDF is visible to Explorer roles if True

  • extension (str): UDF code syntax type

  • update_time (str): Date and time data was updated as ISO 8601 compliant time

  • updated_by (int): User ID of last updater

Return type

dict

analyze.udf.view_explorer(project_id, udf_ids, allowed=True, branch='master')

Sets View Explorer flag

Parameters
  • project_id (str) – Unique project identifier

  • udf_ids (str) – Unique udf identifier or list of identifiers

  • allowed (bool) – Indicate whether Explorer role can view item

  • branch (str) – Project branch

Returns

None

analyze.udf.view_manager(project_id, udf_ids, allowed=True, branch='master')

Sets View Manager flag

Parameters
  • project_id (str) – Unique project identifier

  • udf_ids (str) – Unique udf identifier or list of identifiers

  • allowed (bool) – Indicate whether Manager role can view item

  • branch (str) – Project branch

Returns

None