abacusai.python_function_validator ================================== .. py:module:: abacusai.python_function_validator Classes ------- .. autoapisummary:: abacusai.python_function_validator._MonkeyPatch Functions --------- .. autoapisummary:: abacusai.python_function_validator.validate_function_locally Module Contents --------------- .. py:function:: validate_function_locally(client, python_function_name, 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 client: The AbacusAI client. :type client: ApiClient :param python_function_name: The name of the Python function registered in Abacus.AI to execute. :type python_function_name: str :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. .. py:class:: _MonkeyPatch Helper class to prepend to ``sys.path`` and undo monkeypatching of attributes :syspath_prepend: prepend to ``sys.path`` list of import locations :undo: undo all changes made .. py:attribute:: _savesyspath :type: Optional[List[str]] :value: None .. py:method:: context() :classmethod: .. py:method:: syspath_prepend(path) Prepend ``path`` to ``sys.path`` list of import locations. .. py:method:: undo() Undo all monkeypatching done by this object.