abacusai.feature_group_version
==============================

.. py:module:: abacusai.feature_group_version


Classes
-------

.. autoapisummary::

   abacusai.feature_group_version.AnnotationConfig
   abacusai.feature_group_version.CodeSource
   abacusai.feature_group_version.Feature
   abacusai.feature_group_version.IndexingConfig
   abacusai.feature_group_version.PointInTimeGroup
   abacusai.feature_group_version.AbstractApiClass
   abacusai.feature_group_version.FeatureGroupVersion


Module Contents
---------------

.. py:class:: AnnotationConfig(client, featureAnnotationConfigs=None, labels=None, statusFeature=None, commentsFeatures=None, metadataFeature=None)

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`


   Annotation config for a feature group

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param featureAnnotationConfigs: List of feature annotation configs
   :type featureAnnotationConfigs: list
   :param labels: List of labels
   :type labels: list
   :param statusFeature: Name of the feature that contains the status of the annotation (Optional)
   :type statusFeature: str
   :param commentsFeatures: Features that contain comments for the annotation (Optional)
   :type commentsFeatures: list
   :param metadataFeature: Name of the feature that contains the metadata for the annotation (Optional)
   :type metadataFeature: str


   .. py:method:: __repr__()

      Return repr(self).



   .. 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:class:: CodeSource(client, sourceType=None, sourceCode=None, applicationConnectorId=None, applicationConnectorInfo=None, packageRequirements=None, status=None, error=None, publishingMsg=None, moduleDependencies=None)

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`


   Code source for python-based custom feature groups and models

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param sourceType: The type of the source, one of TEXT, PYTHON, FILE_UPLOAD, or APPLICATION_CONNECTOR
   :type sourceType: str
   :param sourceCode: If the type of the source is TEXT, the raw text of the function
   :type sourceCode: str
   :param applicationConnectorId: The Application Connector to fetch the code from
   :type applicationConnectorId: str
   :param applicationConnectorInfo: Args passed to the application connector to fetch the code
   :type applicationConnectorInfo: str
   :param packageRequirements: The pip package dependencies required to run the code
   :type packageRequirements: list
   :param status: The status of the code and validations
   :type status: str
   :param error: If the status is failed, an error message describing what went wrong
   :type error: str
   :param publishingMsg: Warnings in the source code
   :type publishingMsg: dict
   :param moduleDependencies: The list of internal modules dependencies required to run the code
   :type moduleDependencies: list


   .. py:method:: __repr__()

      Return repr(self).



   .. 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:: import_as_cell()

      Adds the source code as an unexecuted cell in the notebook.



.. py:class:: Feature(client, name=None, selectClause=None, featureMapping=None, sourceTable=None, originalName=None, usingClause=None, orderClause=None, whereClause=None, featureType=None, dataType=None, detectedFeatureType=None, detectedDataType=None, columns={}, pointInTimeInfo={})

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`


   A feature in a feature group

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param name: The unique name of the column
   :type name: str
   :param selectClause: The sql logic for creating this feature's data
   :type selectClause: str
   :param featureMapping: The Feature Mapping of the feature
   :type featureMapping: str
   :param sourceTable: The source table of the column
   :type sourceTable: str
   :param originalName: The original name of the column
   :type originalName: str
   :param usingClause: Nested Column Using Clause
   :type usingClause: str
   :param orderClause: Nested Column Ordering Clause
   :type orderClause: str
   :param whereClause: Nested Column Where Clause
   :type whereClause: str
   :param featureType: Feature Type of the Feature
   :type featureType: str
   :param dataType: Data Type of the Feature
   :type dataType: str
   :param detectedFeatureType: The detected feature type of the column
   :type detectedFeatureType: str
   :param detectedDataType: The detected data type of the column
   :type detectedDataType: str
   :param columns: Nested Features
   :type columns: NestedFeature
   :param pointInTimeInfo: Point in time column information
   :type pointInTimeInfo: PointInTimeFeature


   .. py:method:: __repr__()

      Return repr(self).



   .. 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:class:: IndexingConfig(client, primaryKey=None, updateTimestampKey=None, lookupKeys=None)

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`


   The indexing config for a Feature Group

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param primaryKey: A single key index
   :type primaryKey: str
   :param updateTimestampKey: The primary timestamp feature
   :type updateTimestampKey: str
   :param lookupKeys: A multi-key index. Cannot be used in conjuction with primary key.
   :type lookupKeys: list[str]


   .. py:method:: __repr__()

      Return repr(self).



   .. 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:class:: PointInTimeGroup(client, groupName=None, windowKey=None, aggregationKeys=None, lookbackWindow=None, lookbackWindowLag=None, lookbackCount=None, lookbackUntilPosition=None, historyTableName=None, historyWindowKey=None, historyAggregationKeys=None, features={})

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`


   A point in time group containing point in time features

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param groupName: The name of the point in time group
   :type groupName: str
   :param windowKey: Name of feature which contains the timestamp value for the point in time feature
   :type windowKey: str
   :param aggregationKeys: List of keys to use for join the historical table and performing the window aggregation.
   :type aggregationKeys: list
   :param lookbackWindow: Number of seconds in the past from the current time for start of the window.
   :type lookbackWindow: float
   :param lookbackWindowLag: Optional lag to offset the closest point for the window. If it is positive, we delay the start of window. If it is negative, we are looking at the "future" rows in the history table.
   :type lookbackWindowLag: float
   :param lookbackCount: If window is specified in terms of count, the start position of the window (0 is the current row)
   :type lookbackCount: int
   :param lookbackUntilPosition: Optional lag to offset the closest point for the window. If it is positive, we delay the start of window by that many rows. If it is negative, we are looking at those many "future" rows in the history table.
   :type lookbackUntilPosition: int
   :param historyTableName: The table to use for aggregating, if not provided, the source table will be used
   :type historyTableName: str
   :param historyWindowKey: Name of feature to use for ordering the rows on the history table. If not provided, the windowKey from the source table will be used
   :type historyWindowKey: str
   :param historyAggregationKeys: List of keys to use for join the historical table and performing the window aggregation. If not provided, the aggregationKeys from the source table will be used. Must be the same length and order as the source table's aggregationKeys
   :type historyAggregationKeys: list
   :param features: List of features in the Point in Time group
   :type features: PointInTimeGroupFeature


   .. py:method:: __repr__()

      Return repr(self).



   .. 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:class:: AbstractApiClass(client, id)

   .. py:method:: __eq__(other)

      Return self==value.



   .. py:method:: _get_attribute_as_dict(attribute)


.. py:class:: FeatureGroupVersion(client, featureGroupVersion=None, featureGroupId=None, sql=None, sourceTables=None, sourceDatasetVersions=None, createdAt=None, status=None, error=None, deployable=None, cpuSize=None, memory=None, useOriginalCsvNames=None, pythonFunctionBindings=None, indexingConfigWarningMsg=None, materializationStartedAt=None, materializationCompletedAt=None, columns=None, templateBindings=None, features={}, pointInTimeGroups={}, codeSource={}, annotationConfig={}, indexingConfig={})

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`


   A materialized version of a feature group

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param featureGroupVersion: The unique identifier for this materialized version of feature group.
   :type featureGroupVersion: str
   :param featureGroupId: The unique identifier of the feature group this version belongs to.
   :type featureGroupId: str
   :param sql: The sql definition creating this feature group.
   :type sql: str
   :param sourceTables: The source tables for this feature group.
   :type sourceTables: list[str]
   :param sourceDatasetVersions: The dataset version ids for this feature group version.
   :type sourceDatasetVersions: list[str]
   :param createdAt: The timestamp at which the feature group version was created.
   :type createdAt: str
   :param status: The current status of the feature group version.
   :type status: str
   :param error: Relevant error if the status is FAILED.
   :type error: str
   :param deployable: whether feature group is deployable or not.
   :type deployable: bool
   :param cpuSize: Cpu size specified for the python feature group.
   :type cpuSize: str
   :param memory: Memory in GB specified for the python feature group.
   :type memory: int
   :param useOriginalCsvNames: If true, the feature group will use the original column names in the source dataset.
   :type useOriginalCsvNames: bool
   :param pythonFunctionBindings: Config specifying variable names, types, and values to use when resolving a Python feature group.
   :type pythonFunctionBindings: list
   :param indexingConfigWarningMsg: The warning message related to indexing keys.
   :type indexingConfigWarningMsg: str
   :param materializationStartedAt: The timestamp at which the feature group materialization started.
   :type materializationStartedAt: str
   :param materializationCompletedAt: The timestamp at which the feature group materialization completed.
   :type materializationCompletedAt: str
   :param columns: List of resolved columns.
   :type columns: list[feature]
   :param templateBindings: Template variable bindings used for resolving the template.
   :type templateBindings: list
   :param features: List of features.
   :type features: Feature
   :param pointInTimeGroups: List of Point In Time Groups
   :type pointInTimeGroups: PointInTimeGroup
   :param codeSource: If a python feature group, information on the source code
   :type codeSource: CodeSource
   :param annotationConfig: The annotations config for the feature group.
   :type annotationConfig: AnnotationConfig
   :param indexingConfig: The indexing config for the feature group.
   :type indexingConfig: IndexingConfig


   .. py:method:: __repr__()

      Return repr(self).



   .. 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:: create_snapshot_feature_group(table_name)

      Creates a Snapshot Feature Group corresponding to a specific Feature Group version.

      :param table_name: Name for the newly created Snapshot Feature Group table. Can be up to 120 characters long and can only contain alphanumeric characters and underscores.
      :type table_name: str

      :returns: Feature Group corresponding to the newly created Snapshot.
      :rtype: FeatureGroup



   .. py:method:: export_to_file_connector(location, export_file_format, overwrite = False)

      Export Feature group to File Connector.

      :param location: Cloud file location to export to.
      :type location: str
      :param export_file_format: Enum string specifying the file format to export to.
      :type export_file_format: str
      :param overwrite: If true and a file exists at this location, this process will overwrite the file.
      :type overwrite: bool

      :returns: The FeatureGroupExport instance.
      :rtype: FeatureGroupExport



   .. py:method:: export_to_database_connector(database_connector_id, object_name, write_mode, database_feature_mapping, id_column = None, additional_id_columns = None)

      Export Feature group to Database Connector.

      :param database_connector_id: Unique string identifier for the Database Connector to export to.
      :type database_connector_id: str
      :param object_name: Name of the database object to write to.
      :type object_name: str
      :param write_mode: Enum string indicating whether to use INSERT or UPSERT.
      :type write_mode: str
      :param database_feature_mapping: Key/value pair JSON object of "database connector column" -> "feature name" pairs.
      :type database_feature_mapping: dict
      :param id_column: Required if write_mode is UPSERT. Indicates which database column should be used as the lookup key.
      :type id_column: str
      :param additional_id_columns: For database connectors which support it, additional ID columns to use as a complex key for upserting.
      :type additional_id_columns: list

      :returns: The FeatureGroupExport instance.
      :rtype: FeatureGroupExport



   .. py:method:: export_to_console(export_file_format)

      Export Feature group to console.

      :param export_file_format: File format to export to.
      :type export_file_format: str

      :returns: The FeatureGroupExport instance.
      :rtype: FeatureGroupExport



   .. py:method:: get_materialization_logs(stdout = False, stderr = False)

      Returns logs for a materialized feature group version.

      :param stdout: Set to True to get info logs.
      :type stdout: bool
      :param stderr: Set to True to get error logs.
      :type stderr: bool

      :returns: A function logs object.
      :rtype: FunctionLogs



   .. py:method:: refresh()

      Calls describe and refreshes the current object's fields

      :returns: The current object
      :rtype: FeatureGroupVersion



   .. py:method:: describe()

      Describe a feature group version.

      :param feature_group_version: The unique identifier associated with the feature group version.
      :type feature_group_version: str

      :returns: The feature group version.
      :rtype: FeatureGroupVersion



   .. py:method:: get_metrics(selected_columns = None, include_charts = False, include_statistics = True)

      Get metrics for a specific feature group version.

      :param selected_columns: A list of columns to order first.
      :type selected_columns: List
      :param include_charts: A flag indicating whether charts should be included in the response. Default is false.
      :type include_charts: bool
      :param include_statistics: A flag indicating whether statistics should be included in the response. Default is true.
      :type include_statistics: bool

      :returns: The metrics for the specified feature group version.
      :rtype: DataMetrics



   .. py:method:: get_logs()

      Retrieves the feature group materialization logs.

      :param feature_group_version: The unique version ID of the feature group version.
      :type feature_group_version: str

      :returns: The logs for the specified feature group version.
      :rtype: FeatureGroupVersionLogs



   .. py:method:: wait_for_results(timeout=3600)

      A waiting call until feature group version is materialized

      :param timeout: The waiting time given to the call to finish, if it doesn't finish by the allocated time, the call is said to be timed out.
      :type timeout: int



   .. py:method:: wait_for_materialization(timeout=3600)

      A waiting call until feature group version is materialized.

      :param timeout: The waiting time given to the call to finish, if it doesn't finish by the allocated time, the call is said to be timed out.
      :type timeout: int



   .. py:method:: get_status()

      Gets the status of the feature group version.

      :returns: A string describing the status of a feature group version (pending, complete, etc.).
      :rtype: str



   .. py:method:: _download_avro_file(file_part, tmp_dir, part_index)


   .. py:method:: load_as_pandas(max_workers=10)

      Loads the feature group version into a pandas dataframe.

      :param max_workers: The number of threads.
      :type max_workers: int

      :returns: A pandas dataframe displaying the data in the feature group version.
      :rtype: DataFrame



   .. py:method:: load_as_pandas_documents(doc_id_column, document_column, max_workers=10)

      Loads a feature group with documents data into a pandas dataframe.

      :param doc_id_feature: The name of the feature / column containing the document ID.
      :type doc_id_feature: str
      :param document_feature: The name of the feature / column which either contains the document data itself or page infos with path to remotely stored documents. This column will be replaced with the extracted document data.
      :type document_feature: str
      :param max_workers: The number of threads.
      :type max_workers: int

      :returns: A pandas dataframe containing the extracted document data.
      :rtype: DataFrame



