feature_store package#
Submodules#
ads.feature_store.query package#
- class ads.feature_store.query.filter.Filter(feature, condition, value, **kwargs)[source]#
Bases:
BuilderRepresents a filter for a query.
- CONST_CONDITION = 'condition'#
- CONST_FEATURE = 'feature'#
- CONST_VALUE = 'value'#
- property condition#
- property feature#
- to_dict()[source]#
Converts the object to dictionary with kind, type and spec as keys.
- Parameters:
**kwargs (Dict) –
The additional arguments. - filter_by_attribute_map: bool
If True, then in the result will be included only the fields presented in the attribute_map.
- property value#
- with_condition(condition)[source]#
Sets the condition to apply to the feature.
- Parameters:
condition (str) – The condition to apply to the feature.
- class ads.feature_store.query.filter.Logic(type, left_f=None, right_f=None, left_l=None, right_l=None, **kwargs)[source]#
Bases:
BuilderA class representing a logical operation on filters.
- AND = 'AND'#
- CONST_LEFT_FILTER = 'leftFilter'#
- CONST_LEFT_LOGIC = 'leftLogic'#
- CONST_RIGHT_FILTER = 'rightFilter'#
- CONST_RIGHT_LOGIC = 'rightLogic'#
- CONST_TYPE = 'type'#
- OR = 'OR'#
- SINGLE = 'SINGLE'#
- property left_filter#
- property left_logic#
- property right_filter#
- property right_logic#
- to_dict()[source]#
Converts the object to dictionary with kind, type and spec as keys.
- Parameters:
**kwargs (Dict) –
The additional arguments. - filter_by_attribute_map: bool
If True, then in the result will be included only the fields presented in the attribute_map.
- property type#
The type of the object as showing in YAML.
This implementation returns the class name with the first letter coverted to lower case.
- with_left_filter(left_filter)[source]#
Sets the left filter of the logic.
Parameters:#
- left_filter: Filter or None
The left filter of the logic.
- with_left_logic(left_logic)[source]#
Sets the left logic of the operation.
Parameters:#
- left_logic: Logic or None
The left logic of the operation.
- with_right_filter(right_filter)[source]#
Sets the right filter of the logic.
Parameters:#
- right_filter: Filter or None
The right filter of the logic.
- class ads.feature_store.query.join.Join(query, on, left_on, right_on, join_type: JoinType = JoinType.INNER)[source]#
Bases:
BuilderThe Join class is used to join two tables or datasets.
- Parameters:
query (The table or dataset to join.) –
left_on (A list of column names from the left table to join on.) –
right_on (A list of column names from the right table to join on.) –
(JoinType) (join_type) –
- with_query(query: 'Query') "Join": Sets the query attribute.#
- CONST_JOIN_TYPE = 'joinType'#
- CONST_LEFT_ON = 'leftOn'#
- CONST_ON = 'on'#
- CONST_QUERY = 'query'#
- CONST_RIGHT_ON = 'rightOn'#
- property sub_query: Query#
ads.feature_store package#
- class ads.feature_store.dataset_job.DatasetJob(spec: Dict | None = None, **kwargs)[source]#
Bases:
BuilderRepresents an DatasetJob Resource.
- list(cls, compartment_id: str = None, \*\*kwargs) List['DatasetJob'][source]#
Lists dataset_run resources in a given compartment.
- list_df(cls, compartment_id: str = None, \*\*kwargs) 'pandas.DataFrame'[source]#
Lists dataset_run resources as a pandas dataframe.
- with_ingestion_mode(self, ingestion_mode: IngestionMode) 'DatasetJob'[source]#
Sets the ingestion mode.
Examples
>>> from ads.feature_store import dataset_job >>> import oci >>> import os >>> dataset_run = dataset_run.DatasetJob() >>> .with_compartment_id(os.environ["PROJECT_COMPARTMENT_OCID"]) >>> .with_dataset_id("dataset_id") >>> .with_ingestion_mode(BatchIngestionMode.SQL) >>> dataset_run.create()
- CONST_COMPARTMENT_ID = 'compartmentId'#
- CONST_DATASET_ID = 'datasetId'#
- CONST_DATA_FLOW_EXECUTION_OUTPUT = 'dataFlowBatchExecutionOutput'#
- CONST_DATA_FLOW_READ_WRITE_DETAIL = 'data_flow_read_write_detail'#
- CONST_DATA_READ_IN_BYTES = 'data_read_in_bytes'#
- CONST_DATA_WRITTEN_BYTES = 'data_written_in_bytes'#
- CONST_DEFINED_TAG = 'definedTags'#
- CONST_ERROR_DETAILS = 'errorDetails'#
- CONST_FEATURE_OPTION_DETAILS = 'featureOptionsDetails'#
- CONST_FREEFORM_TAG = 'freeformTags'#
- CONST_ID = 'id'#
- CONST_INGESTION_MODE = 'ingestionMode'#
- CONST_JOB_CONFIGURATION_DETAILS = 'jobConfigurationDetails'#
- CONST_JOB_CONFIGURATION_TYPE = 'jobConfigurationType'#
- CONST_JOB_OUTPUT_DETAILS = 'jobOutputDetails'#
- CONST_LIFECYCLE_STATE = 'lifecycleState'#
- CONST_TIME_FROM = 'timeFrom'#
- CONST_TIME_TO = 'timeTo'#
- CONST_VALIDATION_OUTPUT = 'validation_output'#
- attribute_map = {'compartmentId': 'compartment_id', 'datasetId': 'dataset_id', 'definedTags': 'defined_tags', 'featureOptionsDetails': 'feature_option_details', 'freeformTags': 'freeform_tags', 'id': 'id', 'ingestionMode': 'ingestion_mode', 'jobConfigurationDetails': 'job_configuration_details', 'jobConfigurationType': 'job_configuration_type', 'jobOutputDetails': 'job_output_details', 'timeFrom': 'time_from', 'timeTo': 'time_to'}#
- create(**kwargs) DatasetJob[source]#
Creates dataset_run resource.
- Parameters:
kwargs – Additional kwargs arguments. Can be any attribute that feature_store.models.DatasetJob accepts.
- Returns:
The DatasetJob instance (self)
- Return type:
FeatureStore
- Raises:
ValueError – If compartment id not provided.
- property feature_option_details#
- classmethod from_id(id: str) DatasetJob[source]#
Gets an existing dataset_run resource by Id.
- Parameters:
id (str) – The dataset_run id.
- Returns:
An instance of DatasetJob resource.
- Return type:
FeatureStore
- classmethod list(compartment_id: str | None = None, **kwargs) List[DatasetJob][source]#
Lists DatasetJob Resources in a given compartment.
- Parameters:
compartment_id ((str, optional). Defaults to None.) – The compartment OCID.
kwargs – Additional keyword arguments for filtering DatasetJob.
- Returns:
The list of the DatasetJob Resources.
- Return type:
List[DatasetJob]
- classmethod list_df(compartment_id: str | None = None, **kwargs) DataFrame[source]#
Lists dataset_run resources in a given compartment.
- Parameters:
compartment_id ((str, optional). Defaults to None.) – The compartment OCID.
kwargs – Additional keyword arguments for filtering models.
- Returns:
The list of the dataset_run resources in a pandas dataframe format.
- Return type:
pandas.DataFrame
- to_dict() Dict[source]#
Serializes dataset_run to a dictionary.
- Returns:
The dataset_run resource serialized as a dictionary.
- Return type:
- update(**kwargs) DatasetJob[source]#
Updates DatasetJob in the feature store.
- Parameters:
kwargs – Additional kwargs arguments. Can be any attribute that feature_store.models.DatasetJob accepts.
- Returns:
The DatasetJob instance (self).
- Return type:
- with_compartment_id(compartment_id: str) DatasetJob[source]#
Sets the compartment_id.
- Parameters:
compartment_id (str) – The compartment_id.
- Returns:
The DatasetJob instance (self)
- Return type:
- with_dataset_id(dataset_id: str) DatasetJob[source]#
Sets the dataset_id.
- Parameters:
dataset_id (str) – The dataset id.
- Returns:
The DatasetJob instance (self)
- Return type:
- with_error_details(error_details: str) DatasetJob[source]#
Sets the error details.
- Parameters:
error_details (str) – The error_details.
- Returns:
The DatasetJob instance (self)
- Return type:
- with_feature_option_details(feature_option_details: FeatureOptionDetails) DatasetJob[source]#
Sets the feature_option_details.
- Parameters:
feature_option_details (FeatureOptionDetails) –
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_id(id: str) DatasetJob[source]#
- with_ingestion_mode(ingestion_mode: BatchIngestionMode | StreamingIngestionMode) DatasetJob[source]#
Sets the mode of the dataset ingestion mode.
- Parameters:
ingestion_mode (IngestionMode) – The mode of the dataset ingestion mode.
- Returns:
The DatasetJob instance (self)
- Return type:
- with_job_configuration_details(job_configuration_type: JobConfigurationType, **kwargs: Dict[str, Any]) DatasetJob[source]#
Sets the job configuration details.
- Parameters:
job_configuration_type (JobConfigurationType) – The job_configuration_type of job
kwargs (Dict[str, Any]) – Additional key value arguments
- Returns:
The DatasetJob instance (self)
- Return type:
- with_job_output_details(job_output_details: Dict) DatasetJob[source]#
Sets the job output details.
- Parameters:
job_output_details (Dict) – The job output details which contains error_details, validation_output and commit id.
- Returns:
The DatasetJob instance (self)
- Return type:
- with_lifecycle_state(lifecycle_state: str) DatasetJob[source]#
Sets the lifecycle_state.
- Parameters:
lifecycle_state (str) – The lifecycle_state.
- Returns:
The DatasetJob instance (self)
- Return type:
- class ads.feature_store.feature.DatasetFeature(name, featureType, datasetId)[source]#
Bases:
BuilderA class that represents a feature and allows comparison with other features using various operators. The Feature class has six comparison methods (__lt__, __le__, __eq__, __ne__, __ge__, and __gt__) that return instances of a Filter class. These comparison methods allow instances of the Feature class to be compared using the corresponding comparison operators.
- CONST_DATASET_ID = 'datasetId'#
- CONST_FEATURE_NAME = 'name'#
- CONST_FEATURE_TYPE = 'featureType'#
- property dataset_id#
- property feature_name#
- property feature_type#
- to_dict() Dict[source]#
Serializes feature to a dictionary.
- Returns:
The feature serialized as a dictionary.
- Return type:
- with_dataset_id(dataset_id)[source]#
Sets the group attribute of the feature.
- Parameters:
dataset_id – Dataset id which contains the feature.
- Returns:
This instance of the Feature class.
- Return type:
- class ads.feature_store.feature.Feature(name, featureType, featureGroupId)[source]#
Bases:
BuilderA class that represents a feature and allows comparison with other features using various operators. The Feature class has six comparison methods (__lt__, __le__, __eq__, __ne__, __ge__, and __gt__) that return instances of a Filter class. These comparison methods allow instances of the Feature class to be compared using the corresponding comparison operators.
- CONST_FEATURE_GROUP_ID = 'featureGroupId'#
- CONST_FEATURE_NAME = 'name'#
- CONST_FEATURE_TYPE = 'featureType'#
- property feature_group_id#
- property feature_name#
- property feature_type#
- to_dict() Dict[source]#
Serializes feature to a dictionary.
- Returns:
The feature serialized as a dictionary.
- Return type:
- with_feature_group_id(feature_group_id)[source]#
Sets the group attribute of the feature.
- Parameters:
feature_group_id – FeatureGroup id which contains the feature.
- Returns:
This instance of the Feature class.
- Return type:
- class ads.feature_store.feature_group_job.FeatureGroupJob(spec: Dict | None = None, **kwargs)[source]#
Bases:
BuilderRepresents an FeatureGroupJob Resource.
- list(cls, compartment_id: str = None, \*\*kwargs) List['FeatureGroupJob'][source]#
Lists feature_group_run resources in a given compartment.
- list_df(cls, compartment_id: str = None, \*\*kwargs) 'pandas.DataFrame'[source]#
Lists feature_group_run resources as a pandas dataframe.
- with_feature_group_id(self, feature_group_id: str) 'FeatureGroupJob'[source]#
Sets the feature group ID.
- with_ingestion_mode(self, ingestion_mode: IngestionMode) 'FeatureGroupJob'[source]#
Sets the ingestion mode.
Examples
>>> from ads.feature_store import feature_group_job >>> import oci >>> import os >>> feature_group_run = feature_group_run.FeatureGroupJob() >>> .with_compartment_id(os.environ["PROJECT_COMPARTMENT_OCID"]) >>> .with_feature_group_id("<feature_group_id>") >>> .with_ingestion_mode(IngestionMode.OVERWRITE) >>> feature_group_run.create()
- CONST_COMPARTMENT_ID = 'compartmentId'#
- CONST_DATA_FLOW_EXECUTION_OUTPUT = 'dataFlowBatchExecutionOutput'#
- CONST_DATA_FLOW_READ_WRITE_DETAIL = 'data_flow_read_write_detail'#
- CONST_DATA_READ_IN_BYTES = 'data_read_in_bytes'#
- CONST_DATA_WRITTEN_BYTES = 'data_written_in_bytes'#
- CONST_DEFINED_TAG = 'definedTags'#
- CONST_FEATURE_GROUP_ID = 'featureGroupId'#
- CONST_FEATURE_OPTION_DETAILS = 'featureOptionsDetails'#
- CONST_FEATURE_STATISTICS = 'featureStatistics'#
- CONST_FREEFORM_TAG = 'freeformTags'#
- CONST_ID = 'id'#
- CONST_INGESTION_MODE = 'ingestionMode'#
- CONST_JOB_CONFIGURATION_DETAILS = 'jobConfigurationDetails'#
- CONST_JOB_CONFIGURATION_TYPE = 'jobConfigurationType'#
- CONST_JOB_OUTPUT_DETAILS = 'jobOutputDetails'#
- CONST_LIFECYCLE_STATE = 'lifecycleState'#
- CONST_TIME_FROM = 'timeFrom'#
- CONST_TIME_TO = 'timeTo'#
- CONST_VALIDATION_OUTPUT = 'validation_output'#
- attribute_map = {'compartmentId': 'compartment_id', 'dataFlowBatchExecutionOutput': 'data_flow_batch_execution_output', 'definedTags': 'defined_tags', 'featureGroupId': 'feature_group_id', 'featureOptionsDetails': 'feature_option_details', 'featureStatistics': 'feature_statistics', 'freeformTags': 'freeform_tags', 'id': 'id', 'ingestionMode': 'ingestion_mode', 'jobConfigurationDetails': 'job_configuration_details', 'jobConfigurationType': 'job_configuration_type', 'jobOutputDetails': 'job_output_details', 'lifecycleState': 'lifecycle_state', 'timeFrom': 'time_from', 'timeTo': 'time_to'}#
- create(**kwargs) FeatureGroupJob[source]#
Creates feature_group_run resource.
- Parameters:
kwargs – Additional kwargs arguments. Can be any attribute that feature_store.models.FeatureGroupJob accepts.
- Returns:
The FeatureGroupJob instance (self)
- Return type:
FeatureStore
- Raises:
ValueError – If compartment id not provided.
- classmethod from_id(id: str) FeatureGroupJob[source]#
Gets an existing feature_group_run resource by Id.
- Parameters:
id (str) – The feature_group_run id.
- Returns:
An instance of FeatureGroupJob resource.
- Return type:
FeatureStore
- get_validation_output_df() DataFrame[source]#
This method retrieves the validation output as a Pandas DataFrame.
Returns: pandas.DataFrame – The validation output data in DataFrame format.
- classmethod list(compartment_id: str | None = None, **kwargs) List[FeatureGroupJob][source]#
Lists FeatureGroupJob Resources in a given compartment.
- Parameters:
compartment_id ((str, optional). Defaults to None.) – The compartment OCID.
kwargs – Additional keyword arguments for filtering FeatureGroupJob.
- Returns:
The list of the FeatureGroupJob Resources.
- Return type:
List[FeatureGroupJob]
- classmethod list_df(compartment_id: str | None = None, **kwargs) DataFrame[source]#
Lists feature_group_run resources in a given compartment.
- Parameters:
compartment_id ((str, optional). Defaults to None.) – The compartment OCID.
kwargs – Additional keyword arguments for filtering models.
- Returns:
The list of the feature_group_run resources in a pandas dataframe format.
- Return type:
pandas.DataFrame
- to_dict() Dict[source]#
Serializes feature_group_run to a dictionary.
- Returns:
The feature_group_run resource serialized as a dictionary.
- Return type:
- update(**kwargs) FeatureGroupJob[source]#
Updates FeatureGroupJob in the feature store.
- Parameters:
kwargs – Additional kwargs arguments. Can be any attribute that feature_store.models.FeatureGroupJob accepts.
- Returns:
The FeatureGroupJob instance (self).
- Return type:
- with_compartment_id(compartment_id: str) FeatureGroupJob[source]#
Sets the compartment_id.
- Parameters:
compartment_id (str) – The compartment_id.
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_feature_group_id(feature_group_id: str) FeatureGroupJob[source]#
Sets the feature_group_id.
- Parameters:
feature_group_id (str) – The feature group id.
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_feature_option_details(feature_option_details: FeatureOptionDetails) FeatureGroupJob[source]#
Sets the feature_option_details.
- Parameters:
feature_option_details (FeatureOptionDetails) –
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_feature_statistics(feature_statistics: str) FeatureGroupJob[source]#
Sets the computed statistics.
- Parameters:
feature_statistics (str) – Computed Feature Statistics
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_id(id: str) FeatureGroupJob[source]#
- with_ingestion_mode(ingestion_mode: BatchIngestionMode | StreamingIngestionMode) FeatureGroupJob[source]#
Sets the mode of the dataset ingestion mode.
- Parameters:
ingestion_mode –
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_job_configuration_details(job_configuration_type: JobConfigurationType, **kwargs: Dict[str, Any]) FeatureGroupJob[source]#
Sets the job configuration details.
- Parameters:
job_configuration_type (JobConfigurationType) – The job_configuration_type of job
kwargs (Dict[str, Any]) – Additional key value arguments
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_job_output_details(job_output_details: Dict) FeatureGroupJob[source]#
Sets the job output details.
- Parameters:
job_output_details (Dict) – The job output details which contains error_details, validation_output and commit id.
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_lifecycle_state(lifecycle_state: str) FeatureGroupJob[source]#
Sets the lifecycle_state.
- Parameters:
lifecycle_state (str) – The lifecycle_state.
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_time_from(time_from: str) FeatureGroupJob[source]#
Sets the time_from.
- Parameters:
time_from (str) – The time_from.
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- with_time_to(time_to: str) FeatureGroupJob[source]#
Sets the time_to.
- Parameters:
time_to (str) – The time_to.
- Returns:
The FeatureGroupJob instance (self)
- Return type:
- class ads.feature_store.feature_group_job.JobConfigurationType(value)[source]#
Bases:
EnumAn enumeration.
- SPARK_BATCH_AUTOMATIC = 'SPARK_BATCH_AUTOMATIC'#
- SPARK_BATCH_MANUAL = 'SPARK_BATCH_MANUAL'#
- class ads.feature_store.feature_option_details.FeatureOptionDetails[source]#
Bases:
Builder- CONST_FEATURE_OPTION_WRITE_CONFIG_DETAILS = 'featureOptionWriteConfigDetails'#
- CONST_MERGE_SCHEMA = 'mergeSchema'#
- CONST_OVERWRITE_SCHEMA = 'overwriteSchema'#
- with_feature_option_write_config_details(merge_schema: bool = False, overwrite_schema: bool = False) FeatureOptionDetails[source]#
Sets the feature option write configuration details.
- Parameters:
- Returns:
The FeatureOptionDetails instance (self)
- Return type:
- class ads.feature_store.input_feature_detail.FeatureDetail(name: str, feature_type: FeatureType | None = None, order_number: int | None = None, is_event_timestamp: bool = False, event_timestamp_format: str | None = None)[source]#
Bases:
BuilderRepresents input Feature Schema.
- with_feature_type(self, feature_type: FeatureType) 'FeatureDetail'[source]#
Sets the feature_type.
- with_event_timestamp_format(self, event_timestamp_format: str) 'FeatureDetail'[source]#
Sets the timestamp format for the feature.
- with_is_event_timestamp_format(self, is_event_timestamp_format: bool) 'FeatureDetail'#
Sets the is_event_timestamp_format.
- CONST_EVENT_TIMESTAMP_FORMAT = 'eventTimestampFormat'#
- CONST_FEATURE_TYPE = 'featureType'#
- CONST_IS_EVENT_TIMESTAMP = 'isEventTimestamp'#
- CONST_NAME = 'name'#
- CONST_ORDER_NUMBER = 'orderNumber'#
- property event_timestamp_format#
- property feature_name#
- property feature_type#
- property is_event_timestamp#
- property order_number#
- with_event_timestamp_format(event_timestamp_format: str) FeatureDetail[source]#
Sets the event_timestamp_format.
- Parameters:
event_timestamp_format (str) – The event_timestamp_format of the Feature.
- Returns:
The FeatureDetail instance (self)
- Return type:
- with_feature_type(feature_type: FeatureType) FeatureDetail[source]#
Sets the feature_type.
- Parameters:
feature_type (FeatureType) – The feature_type of the Feature.
- Returns:
The FeatureDetails instance (self)
- Return type:
FeatureDetails
- with_is_event_timestamp(is_event_timestamp: bool) FeatureDetail[source]#
Sets the is_event_timestamp.
- Parameters:
is_event_timestamp (bool) – The is_event_timestamp of the Feature.
- Returns:
The FeatureDetail instance (self)
- Return type:
- with_order_number(order_number: int) FeatureDetail[source]#
Sets the order number.
- Parameters:
order_number (int) – The order_number of the Feature.
- Returns:
The FeatureDetail instance (self)
- Return type:
- class ads.feature_store.model_details.ModelDetails(items: List[str] | None = None)[source]#
Bases:
BuilderSets the model Details. .. method:: with_items(self, items: List[str]) -> “ModelDetails”
- Set the model ids associated with a dataset
- CONST_ITEMS = 'items'#
- attribute_map = {'items': 'items'}#
- to_dict() Dict[source]#
Serializes rule to a dictionary.
- Returns:
The rule resource serialized as a dictionary.
- Return type:
- class ads.feature_store.statistics_config.StatisticsConfig(is_enabled: bool = True, columns: List[str] | None = None)[source]#
Bases:
BuilderSets the Statistics Config Details. .. method:: with_enabled(self, enabled: bool) -> “StatisticsConfig”
- Sets True/False for enabled
- Sets the column names for the statistics config
- CONST_COLUMNS = 'columns'#
- CONST_ENABLED = 'isEnabled'#
- attribute_map = {'columns': 'columns', 'isEnabled': 'is_enabled'}#
- to_dict() Dict[source]#
Serializes rule to a dictionary.
- Returns:
The rule resource serialized as a dictionary.
- Return type:
- with_columns(columns: List[str]) StatisticsConfig[source]#
Sets the columns for which the stats to be calculated .
- Parameters:
columns (List[str]) – columns for which the stats to be calculated.
- Returns:
The StatisticsConfig instance (self)
- Return type:
- with_is_enabled(is_enabled: bool) StatisticsConfig[source]#
Sets True/False for enabled
- Parameters:
is_enabled (bool) – enable or disable the statistics computation
- Returns:
The StatisticsConfig instance (self)
- Return type:
- class ads.feature_store.transformation.Transformation(spec: Dict | None = None, **kwargs)[source]#
Bases:
BuilderRepresents a Transformation Resource.
- list(cls, compartment_id: str = None, \*\*kwargs) List['Transformation'][source]#
Lists transformation resources in a given compartment.
- list_df(cls, compartment_id: str = None, \*\*kwargs) 'pandas.DataFrame'[source]#
Lists transformation resources as a pandas dataframe.
- with_feature_store_id(self, feature_store_id: str) 'Transformation'[source]#
Sets the feature store ID.
- with_transformation_mode(self, transformation_mode: TransformationMode) 'Transformation'[source]#
Sets the transformation mode.
- with_source_code_function(self, source_code_func) 'Transformation'[source]#
Sets the transformation source code function.
Examples
>>> from ads.feature_store import transformation >>> import oci >>> import os >>> def transactions_df(transactions_batch): >>> sql_query = f"select id, cc_num, amount from {transactions_batch}" >>> return sql_query >>> >>> transformation = transformation.Transformation() >>> .with_description("Feature store description") >>> .with_compartment_id(os.environ["PROJECT_COMPARTMENT_OCID"]) >>> .with_name("FeatureStore") >>> .with_feature_store_id("feature_store_id") >>> .with_transformation_mode(TransformationMode.SQL) >>> .with_source_code_function(transactions_df) >>> transformation.create()
- CONST_COMPARTMENT_ID = 'compartmentId'#
- CONST_DEFINED_TAG = 'definedTags'#
- CONST_DESCRIPTION = 'description'#
- CONST_FEATURE_STORE_ID = 'featureStoreId'#
- CONST_FREEFORM_TAG = 'freeformTags'#
- CONST_FUNCTION_REF = 'functionRef'#
- CONST_ID = 'id'#
- CONST_NAME = 'name'#
- CONST_SOURCE_CODE = 'sourceCode'#
- CONST_TRANSFORMATION_MODE = 'transformationMode'#
- attribute_map = {'compartmentId': 'compartment_id', 'definedTags': 'defined_tags', 'description': 'description', 'featureStoreId': 'feature_store_id', 'freeformTags': 'freeform_tags', 'id': 'id', 'name': 'name', 'sourceCode': 'source_code', 'transformationMode': 'transformation_mode'}#
- create(**kwargs) Transformation[source]#
Creates transformation resource.
- Parameters:
kwargs – Additional kwargs arguments. Can be any attribute that feature_store.models.Transformation accepts.
- Returns:
The Transformation instance (self)
- Return type:
FeatureStore
- Raises:
ValueError – If compartment id not provided.
- classmethod from_id(id: str) Transformation[source]#
Gets an existing Transformation resource by Id.
- Parameters:
id (str) – The Transformation id.
- Returns:
An instance of Transformation resource.
- Return type:
FeatureStore
- classmethod list(compartment_id: str | None = None, **kwargs) List[Transformation][source]#
Lists transformation resources in a given compartment.
- Parameters:
compartment_id ((str, optional). Defaults to None.) – The compartment OCID.
kwargs – Additional keyword arguments for filtering Transformation.
- Returns:
The list of the Transformation Resources.
- Return type:
List[Transformation]
- classmethod list_df(compartment_id: str | None = None, **kwargs) DataFrame[source]#
Lists transformation resources in a given compartment.
- Parameters:
compartment_id ((str, optional). Defaults to None.) – The compartment OCID.
kwargs – Additional keyword arguments for filtering models.
- Returns:
The list of the transformation resources in a pandas dataframe format.
- Return type:
pandas.DataFrame
- to_dict() Dict[source]#
Serializes transformation to a dictionary.
- Returns:
The Transformation resource serialized as a dictionary.
- Return type:
- with_compartment_id(compartment_id: str) Transformation[source]#
Sets the compartment_id.
- Parameters:
compartment_id (str) – The compartment_id.
- Returns:
The Transformation instance (self)
- Return type:
- with_description(description: str) Transformation[source]#
Sets the description.
- Parameters:
description (str) – The description of the transformation resource.
- Returns:
The Transformation instance (self)
- Return type:
FeatureStore
- with_feature_store_id(feature_store_id: str) Transformation[source]#
Sets the feature_store_id.
- Parameters:
feature_store_id (str) – The featurestore id.
- Returns:
The Transformation instance (self)
- Return type:
- with_id(id: str) Transformation[source]#
- with_name(name: str) Transformation[source]#
Sets the name.
- Parameters:
name (str) – The name of Transformation resource.
- Returns:
The Transformation instance (self)
- Return type:
- with_source_code_function(source_code_func) Transformation[source]#
Sets the source code function for the transformation.
- Parameters:
source_code_func (function) – source code for the transformation.
- Returns:
The Transformation instance (self)
- Return type:
- with_transformation_mode(transformation_mode: TransformationMode) Transformation[source]#
Sets the mode of the transformation.
- Parameters:
transformation_mode (TransformationMode) – The mode of the transformation.
- Returns:
The Transformation instance (self)
- Return type:
- class ads.feature_store.validation_output.ValidationOutput(content: str, version: int = 1)[source]#
Bases:
ResponseBuilderRepresents validation output results class after validation.
- property kind: str#
Gets the kind of the validation output object.
- Returns:
The kind of the validation output object, which is always “ValidationOutput”.
- Return type:
ads.feature_store.statistics package#
ads.feature_store.common package#
- class ads.feature_store.common.enums.BatchIngestionMode(value)[source]#
Bases:
EnumAn enumeration that represents the supported Ingestion Mode in feature store.
- None()#
- APPEND = 'APPEND'#
- DEFAULT = 'DEFAULT'#
- OVERWRITE = 'OVERWRITE'#
- UPSERT = 'UPSERT'#
- class ads.feature_store.common.enums.DataFrameType(value)[source]#
Bases:
EnumAn enumeration that represents the supported DataFrame types.
- None()#
- PANDAS = 'PANDAS'#
- SPARK = 'SPARK'#
- class ads.feature_store.common.enums.DatasetIngestionMode(value)[source]#
Bases:
EnumAn enumeration defining the possible modes for ingesting datasets.
- SQL = 'SQL'#
- class ads.feature_store.common.enums.EntityType(value)[source]#
Bases:
EnumAn enumeration of the supported entity types.
- DATASET = 'DATASET'#
- FEATURE_GROUP = 'FEATURE_GROUP'#
- class ads.feature_store.common.enums.ExecutionEngine(value)[source]#
Bases:
EnumAn enumeration that represents the supported execution engines.
- None()#
- PANDAS = 'PANDAS'#
- SPARK = 'SPARK'#
- class ads.feature_store.common.enums.ExpectationType(value)[source]#
Bases:
EnumAn enumeration of the available expectation types for a feature store.
- None()#
- LENIENT = 'LENIENT'#
- NO_EXPECTATION = 'NO_EXPECTATION'#
- STRICT = 'STRICT'#
- class ads.feature_store.common.enums.FeatureStoreJobType(value)[source]#
Bases:
EnumAn enumeration that represents the Job type.
- None()#
- DATASET_DELETION = 'DATASET_DELETION'#
- DATASET_INGESTION = 'DATASET_INGESTION'#
- FEATURE_GROUP_DELETION = 'FEATURE_GROUP_DELETION'#
- FEATURE_GROUP_INGESTION = 'FEATURE_GROUP_INGESTION'#
- class ads.feature_store.common.enums.FeatureType(value)[source]#
Bases:
EnumAn enumeration of the available feature types for a feature store.
- BINARY = 'BINARY'#
- BINARY_ARRAY = 'BINARY_ARRAY'#
- BOOLEAN = 'BOOLEAN'#
- BOOLEAN_ARRAY = 'BOOLEAN_ARRAY'#
- BYTE = 'BYTE'#
- BYTE_ARRAY = 'BYTE_ARRAY'#
- COMPLEX = 'COMPLEX'#
- DATE = 'DATE'#
- DATE_ARRAY = 'DATE_ARRAY'#
- DECIMAL = 'DECIMAL'#
- DOUBLE = 'DOUBLE'#
- DOUBLE_ARRAY = 'DOUBLE_ARRAY'#
- FLOAT = 'FLOAT'#
- FLOAT_ARRAY = 'FLOAT_ARRAY'#
- INTEGER = 'INTEGER'#
- INTEGER_ARRAY = 'INTEGER_ARRAY'#
- LONG = 'LONG'#
- LONG_ARRAY = 'LONG_ARRAY'#
- SHORT = 'SHORT'#
- SHORT_ARRAY = 'SHORT_ARRAY'#
- STRING = 'STRING'#
- STRING_ARRAY = 'STRING_ARRAY'#
- STRING_BINARY_MAP = 'STRING_BINARY_MAP'#
- STRING_BOOLEAN_MAP = 'STRING_BOOLEAN_MAP'#
- STRING_BYTE_MAP = 'STRING_BYTE_MAP'#
- STRING_DATE_MAP = 'STRING_DATE_MAP'#
- STRING_DOUBLE_MAP = 'STRING_DOUBLE_MAP'#
- STRING_FLOAT_MAP = 'STRING_FLOAT_MAP'#
- STRING_INTEGER_MAP = 'STRING_INTEGER_MAP'#
- STRING_LONG_MAP = 'STRING_LONG_MAP'#
- STRING_SHORT_MAP = 'STRING_SHORT_MAP'#
- STRING_STRING_MAP = 'STRING_STRING_MAP'#
- STRING_TIMESTAMP_MAP = 'STRING_TIMESTAMP_MAP'#
- TIMESTAMP = 'TIMESTAMP'#
- TIMESTAMP_ARRAY = 'TIMESTAMP_ARRAY'#
- UNKNOWN = 'UNKNOWN'#
- class ads.feature_store.common.enums.FilterOperators(value)[source]#
Bases:
EnumAn enumeration defining the different comparison operators for data filtering.
- EQ = 'EQUALS'#
- GE = 'GREATER_THAN_OR_EQUAL'#
- GT = 'GREATER_THAN'#
- IN = 'IN'#
- LE = 'LESS_THAN_OR_EQUAL'#
- LK = 'LIKE'#
- LT = 'LESS_THAN'#
- NE = 'NOT_EQUALS'#
- class ads.feature_store.common.enums.IngestionType(value)[source]#
Bases:
EnumThe type of ingestion that can be performed.
- Possible values:
STREAMING: The data is ingested in real time.
BATCH: The data is ingested in batches.
- BATCH = 'BATCH'#
- STREAMING = 'STREAMING'#
- class ads.feature_store.common.enums.JobConfigurationType(value)[source]#
Bases:
EnumAn enumeration defining the different types of job configuration modes for Spark.
- SPARK_BATCH_AUTOMATIC#
A string representing automatic job configuration mode for Spark Batch jobs.
- Type:
- SPARK_BATCH_MANUAL#
A string representing manual job configuration mode for Spark Batch jobs.
- Type:
- SPARK_BATCH_AUTOMATIC = 'SPARK_BATCH_AUTOMATIC'#
- SPARK_BATCH_MANUAL = 'SPARK_BATCH_MANUAL'#
- class ads.feature_store.common.enums.JobStatus(value)[source]#
Bases:
EnumAn enumeration that represents the supported Job status.
- None()#
- CODE_EXECUTION = 'CODE_EXECUTION'#
- FAILED = 'FAILED'#
- SUCCEEDED = 'SUCCEEDED'#
- class ads.feature_store.common.enums.JoinType(value)[source]#
Bases:
EnumEnumeration of supported SQL join types.
- INNER#
Inner join.
- LEFT#
Left join.
- RIGHT#
Right join.
- FULL#
Full outer join.
- CROSS#
Cross join.
- LEFT_SEMI_JOIN#
Left semi join.
- CROSS = 'CROSS'#
- FULL = 'FULL'#
- INNER = 'INNER'#
- LEFT = 'LEFT'#
- LEFT_SEMI_JOIN = 'LEFT_SEMI_JOIN'#
- RIGHT = 'RIGHT'#
- class ads.feature_store.common.enums.LevelType(value)[source]#
Bases:
EnumAn enumeration defining the different types of logging levels.
- ERROR#
A string representing the highest logging level, indicating an error in the program.
- Type:
- WARNING#
A string representing a lower logging level, indicating a potential issue or warning in the program.
- Type:
- ERROR = 'ERROR'#
- WARNING = 'WARNING'#
- class ads.feature_store.common.enums.LifecycleState(value)[source]#
Bases:
EnumAn enumeration that represents the lifecycle state of feature store resources.
- None()#
- ACTIVE = 'ACTIVE'#
- FAILED = 'FAILED'#
- NEEDS_ATTENTION = 'NEEDS_ATTENTION'#
- class ads.feature_store.common.enums.StreamingIngestionMode(value)[source]#
Bases:
EnumEnumeration for stream ingestion modes.
COMPLETE: Represents complete stream ingestion where the entire dataset is replaced.
APPEND: Represents appending new data to the existing dataset.
UPDATE: Represents updating existing data in the dataset.
- APPEND = 'APPEND'#
- COMPLETE = 'COMPLETE'#
- UPDATE = 'UPDATE'#
- class ads.feature_store.common.enums.TransformationMode(value)[source]#
Bases:
EnumAn enumeration defining the different modes for data transformation.
- SQL#
A string representing the SQL mode, which is used to transform data using SQL queries.
- Type:
- PANDAS#
A string representing the Pandas mode, which is used to transform data using the Pandas library.
- Type:
- PANDAS = 'pandas'#
- SPARK = 'spark'#
- SQL = 'sql'#