# `abacusai.feature_group`

## Module Contents

### Classes

`FeatureGroup` | A feature group.

class abacusai.feature_group.FeatureGroup(client, modificationLock=None, featureGroupId=None, name=None, featureGroupSourceType=None, tableName=None, sql=None, datasetId=None, functionSourceCode=None, functionName=None, sourceTables=None, createdAt=None, description=None, featureGroupType=None, sqlError=None, latestVersionOutdated=None, referencedFeatureGroups=None, tags=None, primaryKey=None, updateTimestampKey=None, lookupKeys=None, streamingEnabled=None, featureGroupUse=None, incremental=None, mergeConfig=None, transformConfig=None, samplingConfig=None, cpuSize=None, memory=None, streamingReady=None, featureTags=None, moduleName=None, templateBindings=None, featureExpression=None, useOriginalCsvNames=None, pythonFunctionBindings=None, pythonFunctionName=None, annotationConfig=None, projectConfig=None, features={}, duplicateFeatures={}, pointInTimeGroups={}, concatenationConfig={}, indexingConfig={}, codeSource={}, featureGroupTemplate={}, latestFeatureGroupVersion={})

  Bases: `abacusai.return_class.AbstractApiClass`

  A feature group.

  Parameters:

    - client (ApiClient) – An authenticated API Client instance

    - modificationLock (bool) – If feature group is locked against a change or not.

    - featureGroupId (str) – Unique identifier for this feature group.

    - name (str) – [DEPRECATED] User friendly name for the feature group.

    - featureGroupSourceType (str) – The source type of the feature group

    - tableName (str) – Unique table name of this feature group.

    - sql (str) – SQL definition creating this feature group.

    - datasetId (str) – Dataset ID the feature group is sourced from.

    - functionSourceCode (str) – Source definition creating this feature group.

    - functionName (str) – Function name to execute from the source code.

    - sourceTables (list[str]) – Source tables for this feature group.

    - createdAt (str) – Timestamp at which the feature group was created.

    - description (str) – Description of the feature group.

    - featureGroupType (str) – Project type when the feature group is used in the context of a project.

    - sqlError (str) – Error message with this feature group.

    - latestVersionOutdated (bool) – Is latest materialized feature group version outdated.

    - referencedFeatureGroups (list[str]) – Feature groups this feature group is used in.

    - tags (list[str]) – Tags added to this feature group.

    - primaryKey (str) – Primary index feature.

    - updateTimestampKey (str) – Primary timestamp feature.

    - lookupKeys (list[str]) – Additional indexed features for this feature group.

    - streamingEnabled (bool) – If true, the feature group can have data streamed to it.

    - featureGroupUse (str) – User assigned feature group use which allows for organizing feature groups in a project.

    - incremental (bool) – If feature group corresponds to an incremental dataset.

    - mergeConfig (dict) – Merge configuration settings for the feature group.

    - transformConfig (dict) – Transform configuration settings for the feature group.

    - samplingConfig (dict) – Sampling configuration for the feature group.

    - cpuSize (str) – CPU size specified for the Python feature group.

    - memory (int) – Memory in GB specified for the Python feature group.

    - streamingReady (bool) – If true, the feature group is ready to receive streaming data.

    - featureTags (dict) – Tags for features in this feature group

    - moduleName (str) – Path to the file with the feature group function.

    - templateBindings (dict) – Config specifying variable names and values to use when resolving a feature group template.

    - featureExpression (str) – If the dataset feature group has custom features, the SQL select expression creating those features.

    - useOriginalCsvNames (bool) – If true, the feature group will use the original column names in the source dataset.

    - pythonFunctionBindings (dict) – Config specifying variable names, types, and values to use when resolving a Python feature group.

    - pythonFunctionName (str) – Name of the Python function the feature group was built from.

    - annotationConfig (annotationconfig) – Annotation config for this feature

    - projectConfig (dict) – Project-specific config for this feature group.

    - features (Feature) – List of resolved features.

    - duplicateFeatures (Feature) – List of duplicate features.

    - pointInTimeGroups (PointInTimeGroup) – List of Point In Time Groups.

    - latestFeatureGroupVersion (FeatureGroupVersion) – Latest feature group version.

    - concatenationConfig (ConcatenationConfig) – Feature group ID whose data will be concatenated into this feature group.

    - indexingConfig (IndexingConfig) – Indexing config for the feature group for feature store

    - codeSource (CodeSource) – If a Python feature group, information on the source code.

    - featureGroupTemplate (FeatureGroupTemplate) – FeatureGroupTemplate to use when this feature group is attached to a template.

  __repr__()

    Return repr(self).

  to_dict()

    Get a dict representation of the parameters in this class

    Returns:

      The dict value representation of the class parameters

    Return type:

      dict

  add_to_project(project_id, feature_group_type='CUSTOM_TABLE')

    Adds a feature group to a project.

    Parameters:

      - project_id (str) – The unique ID associated with the project.

      - feature_group_type (str) – The feature group type of the feature group, based on the use case under which the feature group is being created.

  set_project_config(project_id, project_config=None)

    Sets a feature group’s project config

    Parameters:

      - project_id (str) – Unique string identifier for the project.

      - project_config (dict) – JSON object for the feature group’s project configuration.

  remove_from_project(project_id)

    Removes a feature group from a project.

    Parameters:

      project_id (str) – The unique ID associated with the project.

  set_type(project_id, feature_group_type='CUSTOM_TABLE')

    Update the feature group type in a project. The feature group must already be added to the project.

    Parameters:

      - project_id (str) – Unique identifier associated with the project.

      - feature_group_type (str) – The feature group type to set the feature group as.

  use_for_training(project_id, use_for_training=True)

    Use the feature group for model training input

    Parameters:

      - project_id (str) – Unique string identifier associated with the project.

      - use_for_training (bool) – Boolean variable to include or exclude a feature group from a model’s training. Only one feature group per type can be used for training.

  describe_annotation(feature_name=None, doc_id=None, feature_group_row_identifier=None)

    Get the latest annotation entry for a given feature group, feature, and document.

    Parameters:

      - feature_name (str) – The name of the feature the annotation is on.

      - doc_id (str) – The ID of the primary document the annotation is on.

      - feature_group_row_identifier (str) – The key value of the feature group row the annotation is on (cast to string). Usually the primary key value. At least one of the doc_id or key value must be provided in order to identify the correct annotation.

    Returns:

      The latest annotation entry for the given feature group, feature, document, and/or annotation key value.

    Return type:

      AnnotationEntry

  verify_and_describe_annotation(feature_name=None, doc_id=None, feature_group_row_identifier=None)

    Get the latest annotation entry for a given feature group, feature, and document along with verification information.

    Parameters:

      - feature_name (str) – The name of the feature the annotation is on.

      - doc_id (str) – The ID of the primary document the annotation is on.

      - feature_group_row_identifier (str) – The key value of the feature group row the annotation is on (cast to string). Usually the primary key value. At least one of the doc_id or key value must be provided in order to identify the correct annotation.

    Returns:

      The latest annotation entry for the given feature group, feature, document, and/or annotation key value. Includes the verification information.

    Return type:

      AnnotationEntry

  get_document_to_annotate(feature_name, feature_group_row_identifier=None, get_previous=False)

    Get an available document that needs to be annotated for a given feature group and feature.

    Parameters:

      - feature_name (str) – The name of the feature the annotation is on.

      - feature_group_row_identifier (str) – The key value of the feature group row the annotation is on (cast to string). Usually the primary key value. If provided, fetch the immediate next (or previous) available document.

      - get_previous (bool) – If True, get the previous document instead of the next document. Applicable if feature_group_row_identifier is provided.

    Returns:

      The latest annotation entry for the given feature group, feature, document, and/or annotation key value.

    Return type:

      AnnotationEntry

  get_annotations_status(feature_name=None)

    Get the status of the annotations for a given feature group and feature.

    Parameters:

      feature_name (str) – The name of the feature the annotation is on.

    Returns:

      The status of the annotations for the given feature group and feature.

    Return type:

      AnnotationsStatus

  create_sampling(table_name, sampling_config, description=None)

    Creates a new Feature Group defined as a sample of rows from another Feature Group.

    For efficiency, sampling is approximate unless otherwise specified. (e.g. the number of rows may vary slightly from what was requested).

    Parameters:

      - table_name (str) – The unique name to be given to this sampling Feature Group.

      - sampling_config (SamplingConfig) – Dictionary defining the sampling method and its parameters.

      - description (str) – A human-readable description of this Feature Group.

    Returns:

      The created Feature Group.

    Return type:

      FeatureGroup

  set_sampling_config(sampling_config)

    Set a FeatureGroup’s sampling to the config values provided, so that the rows the FeatureGroup returns will be a sample of those it would otherwise have returned.

    Parameters:

      sampling_config (SamplingConfig) – A JSON string object specifying the sampling method and parameters specific to that sampling method. An empty sampling_config indicates no sampling.

    Returns:

      The updated FeatureGroup.

    Return type:

      FeatureGroup

  set_merge_config(merge_config)

    Set a MergeFeatureGroup’s merge config to the values provided, so that the feature group only returns a bounded range of an incremental dataset.

    Parameters:

      merge_config (dict) – JSON object string specifying the merge rule. An empty merge_config will default to only including the latest dataset version.

  set_transform_config(transform_config)

    Set a TransformFeatureGroup’s transform config to the values provided.

    Parameters:

      transform_config (dict) – A dictionary object specifying the pre-defined transformation.

  set_schema(schema)

    Creates a new schema and points the feature group to the new feature group schema ID.

    Parameters:

      schema (list) – JSON string containing an array of objects with ‘name’ and ‘dataType’ properties.

  get_schema(project_id=None)

    Returns a schema for a given FeatureGroup in a project.

    Parameters:

      project_id (str) – The unique ID associated with the project.

    Returns:

      A list of objects for each column in the specified feature group.

    Return type:

      Feature

  create_feature(name, select_expression)

    Creates a new feature in a Feature Group from a SQL select statement.

    Parameters:

      - name (str) – The name of the feature to add.

      - select_expression (str) – SQL SELECT expression to create the feature.

    Returns:

      A Feature Group object with the newly added feature.

    Return type:

      FeatureGroup

  add_tag(tag)

    Adds a tag to the feature group

    Parameters:

      tag (str) – The tag to add to the feature group.

  remove_tag(tag)

    Removes a tag from the specified feature group.

    Parameters:

      tag (str) – The tag to remove from the feature group.

  add_annotatable_feature(name, annotation_type)

    Add an annotatable feature in a Feature Group

    Parameters:

      - name (str) – The name of the feature to add.

      - annotation_type (str) – The type of annotation to set.

    Returns:

      The feature group after the feature has been set

    Return type:

      FeatureGroup

  set_feature_as_annotatable_feature(feature_name, annotation_type, feature_group_row_identifier_feature=None, doc_id_feature=None)

    Sets an existing feature as an annotatable feature (Feature that can be annotated).

    Parameters:

      - feature_name (str) – The name of the feature to set as annotatable.

      - annotation_type (str) – The type of annotation label to add.

      - feature_group_row_identifier_feature (str) – The key value of the feature group row the annotation is on (cast to string) and uniquely identifies the feature group row. At least one of the doc_id or key value must be provided so that the correct annotation can be identified.

      - doc_id_feature (str) – The name of the document ID feature.

    Returns:

      A feature group object with the newly added annotatable feature.

    Return type:

      FeatureGroup

  unset_feature_as_annotatable_feature(feature_name)

    Unsets a feature as annotatable

    Parameters:

      feature_name (str) – The name of the feature to unset.

    Returns:

      The feature group after unsetting the feature

    Return type:

      FeatureGroup

  add_annotation_label(label_name, annotation_type, label_definition=None)

    Adds an annotation label

    Parameters:

      - label_name (str) – The name of the label.

      - annotation_type (str) – The type of the annotation to set.

      - label_definition (str) – the definition of the label.

    Returns:

      The feature group after adding the annotation label

    Return type:

      FeatureGroup

  remove_annotation_label(label_name)

    Removes an annotation label

    Parameters:

      label_name (str) – The name of the label to remove.

    Returns:

      The feature group after adding the annotation label

    Return type:

      FeatureGroup

  add_feature_tag(feature, tag)

    Adds a tag on a feature

    Parameters:

      - feature (str) – The feature to set the tag on.

      - tag (str) – The tag to set on the feature.

  remove_feature_tag(feature, tag)

    Removes a tag from a feature

    Parameters:

      - feature (str) – The feature to remove the tag from.

      - tag (str) – The tag to remove.

  create_nested_feature(nested_feature_name, table_name, using_clause, where_clause=None, order_clause=None)

    Creates a new nested feature in a feature group from a SQL statement.

    Parameters:

      - nested_feature_name (str) – The name of the feature.

      - table_name (str) – The table name of the feature group to nest.

      - using_clause (str) – The SQL join column or logic to join the nested table with the parent.

      - where_clause (str) – A SQL WHERE statement to filter the nested rows.

      - order_clause (str) – A SQL clause to order the nested rows.

    Returns:

      A feature group object with the newly added nested feature.

    Return type:

      FeatureGroup

  update_nested_feature(nested_feature_name, table_name=None, using_clause=None, where_clause=None, order_clause=None, new_nested_feature_name=None)

    Updates a previously existing nested feature in a feature group.

    Parameters:

      - nested_feature_name (str) – The name of the feature to be updated.

      - table_name (str) – The name of the table.

      - using_clause (str) – The SQL join column or logic to join the nested table with the parent.

      - where_clause (str) – An SQL WHERE statement to filter the nested rows.

      - order_clause (str) – An SQL clause to order the nested rows.

      - new_nested_feature_name (str) – New name for the nested feature.

    Returns:

      A feature group object with the updated nested feature.

    Return type:

      FeatureGroup

  delete_nested_feature(nested_feature_name)

    Delete a nested feature.

    Parameters:

      nested_feature_name (str) – The name of the feature to be deleted.

    Returns:

      A feature group object without the specified nested feature.

    Return type:

      FeatureGroup

  create_point_in_time_feature(feature_name, history_table_name, aggregation_keys, timestamp_key, historical_timestamp_key, expression, lookback_window_seconds=None, lookback_window_lag_seconds=0, lookback_count=None, lookback_until_position=0)

    Creates a new point in time feature in a feature group using another historical feature group, window spec, and aggregate expression.

    We use the aggregation keys and either the lookbackWindowSeconds or the lookbackCount values to perform the window aggregation for every row in the current feature group.

    If the window is specified in seconds, then all rows in the history table which match the aggregation keys and with historicalTimeFeature greater than or equal to lookbackStartCount and less than the value of the current rows timeFeature are considered. An optional lookbackWindowLagSeconds (+ve or -ve) can be used to offset the current value of the timeFeature. If this value is negative, we will look at the future rows in the history table, so care must be taken to ensure that these rows are available in the online context when we are performing a lookup on this feature group. If the window is specified in counts, then we order the historical table rows aligning by time and consider rows from the window where the rank order is greater than or equal to lookbackCount and includes the row just prior to the current one. The lag is specified in terms of positions using lookbackUntilPosition.

    Parameters:

      - feature_name (str) – The name of the feature to create.

      - history_table_name (str) – The table name of the history table.

      - aggregation_keys (list) – List of keys to use for joining the historical table and performing the window aggregation.

      - timestamp_key (str) – Name of feature which contains the timestamp value for the point in time feature.

      - historical_timestamp_key (str) – Name of feature which contains the historical timestamp.

      - expression (str) – SQL aggregate expression which can convert a sequence of rows into a scalar value.

      - lookback_window_seconds (float) – If window is specified in terms of time, number of seconds in the past from the current time for start of the window.

      - lookback_window_lag_seconds (float) – 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.

      - lookback_count (int) – If window is specified in terms of count, the start position of the window (0 is the current row).

      - lookback_until_position (int) – 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.

    Returns:

      A feature group object with the newly added nested feature.

    Return type:

      FeatureGroup

  update_point_in_time_feature(feature_name, history_table_name=None, aggregation_keys=None, timestamp_key=None, historical_timestamp_key=None, expression=None, lookback_window_seconds=None, lookback_window_lag_seconds=None, lookback_count=None, lookback_until_position=None, new_feature_name=None)

    Updates an existing Point-in-Time (PiT) feature in a feature group. See createPointInTimeFeature for detailed semantics.

    Parameters:

      - feature_name (str) – The name of the feature.

      - history_table_name (str) – The table name of the history table. If not specified, we use the current table to do a self join.

      - aggregation_keys (list) – List of keys to use for joining the historical table and performing the window aggregation.

      - timestamp_key (str) – Name of the feature which contains the timestamp value for the PiT feature.

      - historical_timestamp_key (str) – Name of the feature which contains the historical timestamp.

      - expression (str) – SQL Aggregate expression which can convert a sequence of rows into a scalar value.

      - lookback_window_seconds (float) – If the window is specified in terms of time, the number of seconds in the past from the current time for the start of the window.

      - lookback_window_lag_seconds (float) – Optional lag to offset the closest point for the window. If it is positive, we delay the start of the window. If it is negative, we are looking at the “future” rows in the history table.

      - lookback_count (int) – If the window is specified in terms of count, the start position of the window (0 is the current row).

      - lookback_until_position (int) – Optional lag to offset the closest point for the window. If it is positive, we delay the start of the window by that many rows. If it is negative, we are looking at those many “future” rows in the history table.

      - new_feature_name (str) – New name for the PiT feature.

    Returns:

      A feature group object with the newly added nested feature.

    Return type:

      FeatureGroup

  create_point_in_time_group(group_name, window_key, aggregation_keys, history_table_name=None, history_window_key=None, history_aggregation_keys=None, lookback_window=None, lookback_window_lag=0, lookback_count=None, lookback_until_position=0)

    Create a Point-in-Time Group

    Parameters:

      - group_name (str) – The name of the point in time group.

      - window_key (str) – Name of feature to use for ordering the rows on the source table.

      - aggregation_keys (list) – List of keys to perform on the source table for the window aggregation.

      - history_table_name (str) – The table to use for aggregating, if not provided, the source table will be used.

      - history_window_key (str) – 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.

      - history_aggregation_keys (list) – 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.

      - lookback_window (float) – Number of seconds in the past from the current time for the start of the window. If 0, the lookback will include all rows.

      - lookback_window_lag (float) – Optional lag to offset the closest point for the window. If it is positive, the start of the window is delayed. If it is negative, “future” rows in the history table are used.

      - lookback_count (int) – If window is specified in terms of count, the start position of the window (0 is the current row).

      - lookback_until_position (int) – Optional lag to offset the closest point for the window. If it is positive, the start of the window is delayed by that many rows. If it is negative, those many “future” rows in the history table are used.

    Returns:

      The feature group after the point in time group has been created.

    Return type:

      FeatureGroup

  update_point_in_time_group(group_name, window_key=None, aggregation_keys=None, history_table_name=None, history_window_key=None, history_aggregation_keys=None, lookback_window=None, lookback_window_lag=None, lookback_count=None, lookback_until_position=None)

    Update Point-in-Time Group

    Parameters:

      - group_name (str) – The name of the point-in-time group.

      - window_key (str) – Name of feature which contains the timestamp value for the point-in-time feature.

      - aggregation_keys (list) – List of keys to use for joining the historical table and performing the window aggregation.

      - history_table_name (str) – The table to use for aggregating, if not provided, the source table will be used.

      - history_window_key (str) – 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.

      - history_aggregation_keys (list) – List of keys to use for joining 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.

      - lookback_window (float) – Number of seconds in the past from the current time for the start of the window.

      - lookback_window_lag (float) – Optional lag to offset the closest point for the window. If it is positive, the start of the window is delayed. If it is negative, future rows in the history table are looked at.

      - lookback_count (int) – If window is specified in terms of count, the start position of the window (0 is the current row).

      - lookback_until_position (int) – Optional lag to offset the closest point for the window. If it is positive, the start of the window is delayed by that many rows. If it is negative, those many future rows in the history table are looked at.

    Returns:

      The feature group after the update has been applied.

    Return type:

      FeatureGroup

  delete_point_in_time_group(group_name)

    Delete point in time group

    Parameters:

      group_name (str) – The name of the point in time group.

    Returns:

      The feature group after the point in time group has been deleted.

    Return type:

      FeatureGroup

  create_point_in_time_group_feature(group_name, name, expression)

    Create point in time group feature

    Parameters:

      - group_name (str) – The name of the point-in-time group.

      - name (str) – The name of the feature to add to the point-in-time group.

      - expression (str) – A SQL aggregate expression which can convert a sequence of rows into a scalar value.

    Returns:

      The feature group after the update has been applied.

    Return type:

      FeatureGroup

  update_point_in_time_group_feature(group_name, name, expression)

    Update a feature’s SQL expression in a point in time group

    Parameters:

      - group_name (str) – The name of the point-in-time group.

      - name (str) – The name of the feature to add to the point-in-time group.

      - expression (str) – SQL aggregate expression which can convert a sequence of rows into a scalar value.

    Returns:

      The feature group after the update has been applied.

    Return type:

      FeatureGroup

  set_feature_type(feature, feature_type)

    Set the type of a feature in a feature group. Specify the feature group ID, feature name, and feature type, and the method will return the new column with the changes reflected.

    Parameters:

      - feature (str) – The name of the feature.

      - feature_type (str) – The machine learning type of the data in the feature. Refer to the [guide on feature types](https://api.abacus.ai/app/help/class/FeatureType) for more information.

    Returns:

      The feature group after the data_type is applied.

    Return type:

      Schema

  invalidate_streaming_data(invalid_before_timestamp)

    Invalidates all streaming data with timestamp before invalidBeforeTimestamp

    Parameters:

      invalid_before_timestamp (int) – Unix timestamp; any data with a timestamp before this time will be invalidated

  concatenate_data(source_feature_group_id, merge_type='UNION', replace_until_timestamp=None, skip_materialize=False)

    Concatenates data from one Feature Group to another. Feature Groups can be merged if their schemas are compatible, they have the special updateTimestampKey column, and (if set) the primaryKey column. The second operand in the concatenate operation will be appended to the first operand (merge target).

    Parameters:

      - source_feature_group_id (str) – The Feature Group to concatenate with the destination Feature Group.

      - merge_type (str) – UNION or INTERSECTION.

      - replace_until_timestamp (int) – The UNIX timestamp to specify the point until which we will replace data from the source Feature Group.

      - skip_materialize (bool) – If True, will not materialize the concatenated Feature Group.

  remove_concatenation_config()

    Removes the concatenation config on a destination feature group.

    Parameters:

      feature_group_id (str) – Unique identifier of the destination feature group to remove the concatenation configuration from.

  refresh()

    Calls describe and refreshes the current object’s fields

    Returns:

      The current object

    Return type:

      FeatureGroup

  describe()

    Describe a Feature Group.

    Parameters:

      feature_group_id (str) – A unique string identifier associated with the feature group.

    Returns:

      The feature group object.

    Return type:

      FeatureGroup

  set_indexing_config(primary_key=None, update_timestamp_key=None, lookup_keys=None)

    Sets various attributes of the feature group used for deployment lookups and streaming updates.

    Parameters:

      - primary_key (str) – Name of the feature which defines the primary key of the feature group.

      - update_timestamp_key (str) – Name of the feature which defines the update timestamp of the feature group. Used in concatenation and primary key deduplication.

      - lookup_keys (list) – List of feature names which can be used in the lookup API to restrict the computation to a set of dataset rows. These feature names have to correspond to underlying dataset columns.

  update(description=None)

    Modify an existing Feature Group.

    Parameters:

      description (str) – Description of the Feature Group.

    Returns:

      Updated Feature Group object.

    Return type:

      FeatureGroup

  detach_from_template()

    Update a feature group to detach it from a template.

    Parameters:

      feature_group_id (str) – Unique string identifier associated with the feature group.

    Returns:

      The updated feature group.

    Return type:

      FeatureGroup

  update_template_bindings(template_bindings=None)

    Update the feature group template bindings for a template feature group.

    Parameters:

      template_bindings (list) – Values in these bindings override values set in the template.

    Returns:

      Updated feature group.

    Return type:

      FeatureGroup

  update_python_function_bindings(python_function_bindings)

    Updates an existing Feature Group’s Python function bindings from a user-provided Python Function. If a list of feature groups are supplied within the Python function bindings, we will provide DataFrames (Pandas in the case of Python) with the materialized feature groups for those input feature groups as arguments to the function.

    Parameters:

      python_function_bindings (list) – 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’}].

  update_python_function(python_function_name, python_function_bindings=[])

    Updates an existing Feature Group’s python function from a user provided Python Function. If a list of feature groups are supplied within the python function

    bindings, we will provide as arguments to the function DataFrame’s (pandas in the case of Python) with the materialized feature groups for those input feature groups.

    Parameters:

      - python_function_name (str) – The name of the python function to be associated with the feature group.

      - python_function_bindings (list) – 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’}].

  update_sql_definition(sql)

    Updates the SQL statement for a feature group.

    Parameters:

      sql (str) – The input SQL statement for the feature group.

    Returns:

      The updated feature group.

    Return type:

      FeatureGroup

  update_dataset_feature_expression(feature_expression)

    Updates the SQL feature expression for a Dataset FeatureGroup’s custom features

    Parameters:

      feature_expression (str) – The input SQL statement for the feature group.

    Returns:

      The updated feature group.

    Return type:

      FeatureGroup

  update_function_definition(function_source_code=None, function_name=None, input_feature_groups=None, cpu_size=None, memory=None, package_requirements=None, use_original_csv_names=False, python_function_bindings=None)

    Updates the function definition for a feature group

    Parameters:

      - function_source_code (str) – Contents of a valid source code file in a supported Feature Group specification language (currently only Python). The source code should contain a function called function_name. A list of allowed import and system libraries for each language is specified in the user functions documentation section.

      - function_name (str) – Name of the function found in the source code that will be executed (on the optional inputs) to materialize this feature group.

      - input_feature_groups (list) – List of feature groups that are supplied to the function as parameters. Each of the parameters are materialized DataFrames (same type as the functions return value).

      - cpu_size (str) – Size of the CPU for the feature group function.

      - memory (int) – Memory (in GB) for the feature group function.

      - package_requirements (list) – List of package requirement strings. For example: [‘numpy==1.2.3’, ‘pandas>=1.4.0’].

      - use_original_csv_names (bool) – If set to True, feature group uses the original column names for input feature groups from CSV datasets.

      - python_function_bindings (list) – 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’}].

    Returns:

      The updated feature group.

    Return type:

      FeatureGroup

  update_zip(function_name, module_name, input_feature_groups=None, cpu_size=None, memory=None, package_requirements=None)

    Updates the ZIP file for a feature group created using createFeatureGroupFromZip.

    Parameters:

      - function_name (str) – The name of the function found in the source code that will be executed (on the optional inputs) to materialize this feature group.

      - module_name (str) – The path to the file with the feature group function.

      - input_feature_groups (list) – A list of feature groups that are supplied to the function as parameters. Each of the parameters are materialized Dataframes (same type as the functions return value).

      - cpu_size (str) – The size of the CPU for the feature group function.

      - memory (int) – The memory (in GB) for the feature group function.

      - package_requirements (list) – A list of package requirement strings. For example: [‘numpy==1.2.3’, ‘pandas>=1.4.0’].

    Returns:

      The Upload to upload the ZIP file to.

    Return type:

      Upload

  update_git(application_connector_id=None, branch_name=None, python_root=None, function_name=None, module_name=None, input_feature_groups=None, cpu_size=None, memory=None, package_requirements=None)

    Updates a feature group created using createFeatureGroupFromGit.

    Parameters:

      - application_connector_id (str) – Unique string identifier associated with the git application connector.

      - branch_name (str) – Name of the branch in the git repository to be used for training.

      - python_root (str) – Path from the top level of the git repository to the directory containing the Python source code. If not provided, the default is the root of the git repository.

      - function_name (str) – Name of the function found in the source code that will be executed (on the optional inputs) to materialize this feature group.

      - module_name (str) – Path to the file with the feature group function.

      - input_feature_groups (list) – List of feature groups that are supplied to the function as parameters. Each of the parameters are materialized Dataframes (same type as the functions return value).

      - cpu_size (str) – Size of the cpu for the feature group function.

      - memory (int) – Memory (in GB) for the feature group function.

      - package_requirements (list) – List of package requirement strings. For example: [‘numpy==1.2.3’, ‘pandas>=1.4.0’].

    Returns:

      The updated FeatureGroup.

    Return type:

      FeatureGroup

  update_feature(name, select_expression=None, new_name=None)

    Modifies an existing feature in a feature group.

    Parameters:

      - name (str) – Name of the feature to be updated.

      - select_expression (str) – SQL statement for modifying the feature.

      - new_name (str) – New name of the feature.

    Returns:

      Updated feature group object.

    Return type:

      FeatureGroup

  list_exports()

    Lists all of the feature group exports for the feature group

    Parameters:

      feature_group_id (str) – Unique identifier of the feature group

    Returns:

      List of feature group exports

    Return type:

      FeatureGroupExport

  set_modifier_lock(locked=True)

    Lock a feature group to prevent modification.

    Parameters:

      locked (bool) – Whether to disable or enable feature group modification (True or False).

  list_modifiers()

    List the users who can modify a given feature group.

    Parameters:

      feature_group_id (str) – Unique string identifier of the feature group.

    Returns:

      Information about the modification lock status and groups/organizations added to the feature group.

    Return type:

      ModificationLockInfo

  add_user_to_modifiers(email)

    Adds a user to a feature group.

    Parameters:

      email (str) – The email address of the user to be added.

  add_organization_group_to_modifiers(organization_group_id)

    Add OrganizationGroup to a feature group modifiers list

    Parameters:

      organization_group_id (str) – Unique string identifier of the organization group.

  remove_user_from_modifiers(email)

    Removes a user from a specified feature group.

    Parameters:

      email (str) – The email address of the user to be removed.

  remove_organization_group_from_modifiers(organization_group_id)

    Removes an OrganizationGroup from a feature group modifiers list

    Parameters:

      organization_group_id (str) – The unique ID associated with the organization group.

  delete_feature(name)

    Removes a feature from the feature group.

    Parameters:

      name (str) – Name of the feature to be deleted.

    Returns:

      Updated feature group object.

    Return type:

      FeatureGroup

  delete()

    Deletes a Feature Group.

    Parameters:

      feature_group_id (str) – Unique string identifier for the feature group to be removed.

  create_version(variable_bindings=None)

    Creates a snapshot for a specified feature group.

    Parameters:

      variable_bindings (dict) – Dictionary defining variable bindings that override parent feature group values.

    Returns:

      A feature group version.

    Return type:

      FeatureGroupVersion

  list_versions(limit=100, start_after_version=None)

    Retrieves a list of all feature group versions for the specified feature group.

    Parameters:

      - limit (int) – The maximum length of the returned versions.

      - start_after_version (str) – Results will start after this version.

    Returns:

      A list of feature group versions.

    Return type:

      FeatureGroupVersion

  create_template(name, template_sql, template_variables, description=None, template_bindings=None, should_attach_feature_group_to_template=False)

    Create a feature group template.

    Parameters:

      - name (str) – User-friendly name for this feature group template.

      - template_sql (str) – The template SQL that will be resolved by applying values from the template variables to generate SQL for a feature group.

      - template_variables (list) – The template variables for resolving the template.

      - description (str) – Description of this feature group template.

      - template_bindings (list) – If the feature group will be attached to the newly created template, set these variable bindings on that feature group.

      - should_attach_feature_group_to_template (bool) – Set to True to convert the feature group to a template feature group and attach it to the newly created template.

    Returns:

      The created feature group template.

    Return type:

      FeatureGroupTemplate

  suggest_template_for()

    Suggest values for a feature gruop template, based on a feature group.

    Parameters:

      feature_group_id (str) – Unique identifier associated with the feature group to use for suggesting values to use in the template.

    Returns:

      None

    Return type:

      FeatureGroupTemplate

  get_recent_streamed_data()

    Returns recently streamed data to a streaming feature group.

    Parameters:

      feature_group_id (str) – Unique string identifier associated with the feature group.

  upsert_data(streaming_token, data)

    Update new data into the feature group for a given lookup key record ID if the record ID is found; otherwise, insert new data into the feature group.

    Parameters:

      - streaming_token (str) – The streaming token for authenticating requests.

      - data (dict) – The data to record, in JSON format.

  append_data(streaming_token, data)

    Appends new data into the feature group for a given lookup key recordId.

    Parameters:

      - streaming_token (str) – The streaming token for authenticating requests.

      - data (dict) – The data to record as a JSON object.

  upsert_multiple_data(streaming_token, data)

    Update new data into the feature group for a given lookup key recordId if the recordId is found; otherwise, insert new data into the feature group.

    Parameters:

      - streaming_token (str) – The streaming token for authenticating requests.

      - data (dict) – The data to record, as a list of JSON objects.

  append_multiple_data(streaming_token, data)

    Appends new data into the feature group for a given lookup key recordId.

    Parameters:

      - streaming_token (str) – Streaming token for authenticating requests.

      - data (list) – Data to record, as a list of JSON objects.

  wait_for_dataset(timeout=7200)

    > A waiting call until the feature group’s dataset, if any, is ready for use.

    Parameters:

      timeout (int, optional) – 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. Default value given is 7200 seconds.

  wait_for_upload(timeout=7200)

    > Waits for a feature group created from a dataframe to be ready for materialization and version creation.

    Parameters:

      timeout (int, optional) – 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. Default value given is 7200 seconds.

  wait_for_materialization(timeout=7200)

    A waiting call until feature group is materialized.

    Parameters:

      timeout (int, optional) – 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. Default value given is 7200 seconds.

  wait_for_streaming_ready(timeout=600)

    Waits for the feature group indexing config to be applied for streaming

    Parameters:

      timeout (int, optional) – 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. Default value given is 600 seconds.

  get_status(streaming_status=False)

    Gets the status of the feature group.

    Returns:

      A string describing the status of a feature group (pending, complete, etc.).

    Return type:

      str

    Parameters:

      streaming_status (bool) –

  load_as_pandas()

    Loads the feature groups into a python pandas dataframe.

    Returns:

      A pandas dataframe with annotations and text_snippet columns.

    Return type:

      DataFrame

  describe_dataset()

    Displays the dataset attached to a feature group.

    Returns:

      A dataset object with all the relevant information about the dataset.

    Return type:

      Dataset

  materialize()

    Materializes the feature group’s latest change at the api call time. It’ll skip materialization if no change since the current latest version.

    Returns:

      A feature group object with the lastest changes materialized.

    Return type:

      FeatureGroup