Skip to content

Commit fdf7c49

Browse files
authored
Update featurestore classes for PuP (Azure#29884)
* Update featurestore classes for PuP
1 parent c35ccfa commit fdf7c49

File tree

48 files changed

+388
-431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+388
-431
lines changed

sdk/ml/azure-ai-ml/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Added experimental scatter gather node to DSL package. This node has a unique mldesigner dependency.
77
- Added support to make JobService and ServiceInstance objects serializable when printed
88
- Support Singularity compute in pipeline job
9+
- Added Feature Store, its dedicated classes and updated the docstrings, now available in public interface. The classes added are `FeatureStoreOperations, FeatureSetOperations, FeatureStoreEntityOperations` with properties classes specific to the new features.
910

1011
### Bugs Fixed
1112

sdk/ml/azure-ai-ml/azure/ai/ml/_artifacts/_artifact_utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def _update_gen2_metadata(name, version, indicator_file, storage_client) -> None
361361

362362
def _check_and_upload_path(
363363
artifact: T,
364-
asset_operations: Union["DataOperations", "ModelOperations", "CodeOperations", "_FeatureSetOperations"],
364+
asset_operations: Union["DataOperations", "ModelOperations", "CodeOperations", "FeatureSetOperations"],
365365
artifact_type: str,
366366
datastore_name: Optional[str] = None,
367367
sas_uri: Optional[str] = None,

sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_input_outputs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def _from_base(cls, _input: Union[Input, Dict]) -> Optional["InternalInput"]:
114114

115115
def _map_v1_io_type(output_type: str) -> str:
116116
"""Map v1 IO type to v2."""
117+
117118
# TODO: put it in a common place
118119
def _map_primitive_type(_type):
119120
"""Convert double and float to number type."""

sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/runsettings/ai_super_computer_configuration.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class PascalCaseProperty(BaseProperty):
11-
1211
_KEY_MAPPING = {}
1312

1413
def items(self):
@@ -21,7 +20,6 @@ def items(self):
2120

2221

2322
class AISuperComputerStorageReferenceConfiguration(PascalCaseProperty):
24-
2523
_KEY_MAPPING = {
2624
"container_name": "ContainerName",
2725
"relative_path": "RelativePath",
@@ -45,7 +43,6 @@ def __init__(
4543

4644

4745
class AISuperComputerScalePolicy(PascalCaseProperty):
48-
4946
_KEY_MAPPING = {
5047
"auto_scale_instance_type_count_set": "AutoScaleInstanceTypeCountSet",
5148
"auto_scale_interval_in_sec": "AutoScaleIntervalInSec",

sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@
103103
from azure.ai.ml.operations._local_deployment_helper import _LocalDeploymentHelper
104104
from azure.ai.ml.operations._local_endpoint_helper import _LocalEndpointHelper
105105
from azure.ai.ml.operations._schedule_operations import ScheduleOperations
106-
from azure.ai.ml.operations._feature_set_operations import _FeatureSetOperations
107-
from azure.ai.ml.operations._feature_store_operations import _FeatureStoreOperations
108-
from azure.ai.ml.operations._feature_store_entity_operations import _FeatureStoreEntityOperations
106+
from azure.ai.ml.operations._feature_set_operations import FeatureSetOperations
107+
from azure.ai.ml.operations._feature_store_operations import FeatureStoreOperations
108+
from azure.ai.ml.operations._feature_store_entity_operations import FeatureStoreEntityOperations
109109

110110
module_logger = logging.getLogger(__name__)
111111

@@ -510,30 +510,29 @@ def __init__(
510510
except Exception as ex: # pylint: disable=broad-except
511511
module_logger.debug("Virtual Cluster operations could not be initialized due to %s ", ex)
512512

513-
self._featurestores = _FeatureStoreOperations(
513+
self._featurestores = FeatureStoreOperations(
514514
self._operation_scope,
515515
self._rp_service_client,
516516
self._operation_container,
517517
self._credential,
518518
**app_insights_handler_kwargs,
519519
)
520520

521-
self._featuresets = _FeatureSetOperations(
521+
self._featuresets = FeatureSetOperations(
522522
self._operation_scope,
523523
self._operation_config,
524-
self._service_client_02_2023_preview,
524+
self._service_client_04_2023_preview,
525525
self._datastores,
526526
**ops_kwargs,
527527
)
528528

529-
self._featurestoreentities = _FeatureStoreEntityOperations(
529+
self._featurestoreentities = FeatureStoreEntityOperations(
530530
self._operation_scope, self._operation_config, self._service_client_02_2023_preview, **ops_kwargs
531531
)
532532

533-
if is_private_preview_enabled():
534-
self._operation_container.add(AzureMLResourceType.FEATURE_STORE, self._featurestores)
535-
self._operation_container.add(AzureMLResourceType.FEATURE_SET, self._featuresets)
536-
self._operation_container.add(AzureMLResourceType.FEATURE_STORE_ENTITY, self._featurestoreentities)
533+
self._operation_container.add(AzureMLResourceType.FEATURE_STORE, self._featurestores)
534+
self._operation_container.add(AzureMLResourceType.FEATURE_SET, self._featuresets)
535+
self._operation_container.add(AzureMLResourceType.FEATURE_STORE_ENTITY, self._featurestoreentities)
537536

538537
@classmethod
539538
def from_config(
@@ -662,36 +661,30 @@ def registries(self) -> RegistryOperations:
662661

663662
@property
664663
@experimental
665-
def _feature_stores(self) -> _FeatureStoreOperations:
664+
def feature_stores(self) -> FeatureStoreOperations:
666665
"""A collection of feature-store related operations.
667666
:return: Featurestore operations
668-
:rtype: _FeatureStoreOperations
667+
:rtype: FeatureStoreOperations
669668
"""
670-
if is_private_preview_enabled():
671-
return self._featurestores
672-
raise Exception("feature store operations not supported")
669+
return self._featurestores
673670

674671
@property
675672
@experimental
676-
def _feature_sets(self) -> _FeatureSetOperations:
673+
def feature_sets(self) -> FeatureSetOperations:
677674
"""A collection of feature set related operations.
678675
:return: FeatureSet operations
679-
:rtype: _FeatureSetOperations
676+
:rtype: FeatureSetOperations
680677
"""
681-
if is_private_preview_enabled():
682-
return self._featuresets
683-
raise Exception("feature set operations not supported")
678+
return self._featuresets
684679

685680
@property
686681
@experimental
687-
def _feature_store_entities(self) -> _FeatureStoreEntityOperations:
682+
def feature_store_entities(self) -> FeatureStoreEntityOperations:
688683
"""A collection of feature store entity related operations.
689684
:return: FeatureStoreEntity operations
690-
:rtype: _FeatureStoreEntityOperations
685+
:rtype: FeatureStoreEntityOperations
691686
"""
692-
if is_private_preview_enabled():
693-
return self._featurestoreentities
694-
raise Exception("feature store entity operations not supported")
687+
return self._featurestoreentities
695688

696689
@property
697690
def connections(self) -> WorkspaceConnectionsOperations:

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_set/feature_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ class FeatureSchema(metaclass=PatchedSchemaMeta):
2525

2626
@post_load
2727
def make(self, data, **kwargs):
28-
from azure.ai.ml.entities._feature_set.feature import _Feature
28+
from azure.ai.ml.entities._feature_set.feature import Feature
2929

30-
return _Feature(description=data.pop("description", None), **data)
30+
return Feature(description=data.pop("description", None), **data)

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_set/feature_set_specification_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class FeatureSetSpecificationSchema(metaclass=PatchedSchemaMeta):
1414

1515
@post_load
1616
def make(self, data, **kwargs):
17-
from azure.ai.ml.entities._feature_set.feature_set_specification import _FeatureSetSpecification
17+
from azure.ai.ml.entities._feature_set.feature_set_specification import FeatureSetSpecification
1818

19-
return _FeatureSetSpecification(**data)
19+
return FeatureSetSpecification(**data)

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_set/materialization_settings_schema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class MaterializationComputeResourceSchema(metaclass=PatchedSchemaMeta):
1717

1818
@post_load
1919
def make(self, data, **kwargs):
20-
from azure.ai.ml.entities._feature_set.materialization_compute_resource import _MaterializationComputeResource
20+
from azure.ai.ml.entities._feature_set.materialization_compute_resource import MaterializationComputeResource
2121

22-
return _MaterializationComputeResource(instance_type=data.pop("instance_type"), **data)
22+
return MaterializationComputeResource(instance_type=data.pop("instance_type"), **data)
2323

2424

2525
class MaterializationSettingsSchema(metaclass=PatchedSchemaMeta):
@@ -32,6 +32,6 @@ class MaterializationSettingsSchema(metaclass=PatchedSchemaMeta):
3232

3333
@post_load
3434
def make(self, data, **kwargs):
35-
from azure.ai.ml.entities._feature_set.materialization_settings import _MaterializationSettings
35+
from azure.ai.ml.entities._feature_set.materialization_settings import MaterializationSettings
3636

37-
return _MaterializationSettings(**data)
37+
return MaterializationSettings(**data)

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_store/compute_runtime_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class ComputeRuntimeSchema(metaclass=PatchedSchemaMeta):
1414

1515
@post_load
1616
def make(self, data, **kwargs):
17-
from azure.ai.ml.entities._workspace.compute_runtime import _ComputeRuntime
17+
from azure.ai.ml.entities._workspace.compute_runtime import ComputeRuntime
1818

19-
return _ComputeRuntime(spark_runtime_version=data.pop("spark_runtime_version"))
19+
return ComputeRuntime(spark_runtime_version=data.pop("spark_runtime_version"))

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_store/materialization_store_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class MaterializationStoreSchema(metaclass=PatchedSchemaMeta):
1515

1616
@post_load
1717
def make(self, data, **kwargs):
18-
from azure.ai.ml.entities._feature_store.materialization_store import _MaterializationStore
18+
from azure.ai.ml.entities._feature_store.materialization_store import MaterializationStore
1919

20-
return _MaterializationStore(
20+
return MaterializationStore(
2121
type=data.pop("type"),
2222
target=data.pop("target"),
2323
)

0 commit comments

Comments
 (0)