abacusai.python_function ======================== .. py:module:: abacusai.python_function Classes ------- .. autoapisummary:: abacusai.python_function.PythonFunction Module Contents --------------- .. py:class:: PythonFunction(client, notebookId=None, name=None, createdAt=None, functionVariableMappings=None, outputVariableMappings=None, functionName=None, pythonFunctionId=None, functionType=None, packageRequirements=None, description=None, examples=None, connectors=None, configurations=None, codeSource={}) Bases: :py:obj:`abacusai.return_class.AbstractApiClass` Customer created python function :param client: An authenticated API Client instance :type client: ApiClient :param notebookId: The unique identifier of the notebook used to spin up the notebook upon creation. :type notebookId: str :param name: The name to identify the algorithm, only uppercase letters, numbers, and underscores allowed (i.e. it must be a valid Python identifier) :type name: str :param createdAt: The ISO-8601 string representing when the Python function was created. :type createdAt: str :param functionVariableMappings: A description of the function variables. :type functionVariableMappings: dict :param outputVariableMappings: A description of the variables returned by the function :type outputVariableMappings: dict :param functionName: The name of the Python function to be used. :type functionName: str :param pythonFunctionId: The unique identifier of the Python function. :type pythonFunctionId: str :param functionType: The type of the Python function. :type functionType: str :param packageRequirements: The pip package dependencies required to run the code :type packageRequirements: list :param description: Description of the Python function. :type description: str :param examples: Dictionary containing example use cases and anti-patterns. Includes 'positive' examples showing recommended usage and 'negative' examples showing cases to avoid. :type examples: dict[str, list[str]] :param connectors: Dictionary containing user-level and organization-level connectors :type connectors: dict :param configurations: Dictionary containing configurations for the Python function :type configurations: dict :param codeSource: Information about the source code of the Python function. :type codeSource: CodeSource .. py:attribute:: notebook_id :value: None .. py:attribute:: name :value: None .. py:attribute:: created_at :value: None .. py:attribute:: function_variable_mappings :value: None .. py:attribute:: output_variable_mappings :value: None .. py:attribute:: function_name :value: None .. py:attribute:: python_function_id :value: None .. py:attribute:: function_type :value: None .. py:attribute:: package_requirements :value: None .. py:attribute:: description :value: None .. py:attribute:: examples :value: None .. py:attribute:: connectors :value: None .. py:attribute:: configurations :value: None .. py:attribute:: code_source .. py:attribute:: deprecated_keys .. py:method:: __repr__() .. py:method:: to_dict() Get a dict representation of the parameters in this class :returns: The dict value representation of the class parameters :rtype: dict .. py:method:: add_graph_to_dashboard(graph_dashboard_id, function_variable_mappings = None, name = None) Add a python plot function to a dashboard :param graph_dashboard_id: Unique string identifier for the graph dashboard to update. :type graph_dashboard_id: str :param function_variable_mappings: List of arguments to be supplied to the function as parameters, in the format [{'name': 'function_argument', 'variable_type': 'FEATURE_GROUP', 'value': 'name_of_feature_group'}]. :type function_variable_mappings: List :param name: Name of the added python plot :type name: str :returns: An object describing the graph dashboard. :rtype: GraphDashboard .. py:method:: validate_locally(kwargs = None) Validates a Python function by running it with the given input values in an local environment. Taking Input Feature Group as either name(string) or Pandas DataFrame in kwargs. :param kwargs: A dictionary mapping function arguments to values to pass to the function. Feature group names will automatically be converted into pandas dataframes. :type kwargs: dict :returns: The result of executing the python function :rtype: any :raises TypeError: If an Input Feature Group argument has an invalid type or argument is missing. :raises Exception: If an error occurs while validating the Python function.