about summary refs log tree commit diff
path: root/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_feature_set/feature.py
diff options
context:
space:
mode:
Diffstat (limited to '.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_feature_set/feature.py')
-rw-r--r--.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_feature_set/feature.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_feature_set/feature.py b/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_feature_set/feature.py
new file mode 100644
index 00000000..2cc54815
--- /dev/null
+++ b/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_feature_set/feature.py
@@ -0,0 +1,54 @@
+# ---------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# ---------------------------------------------------------
+
+# pylint: disable=unused-argument
+
+from typing import Any, Dict, Optional
+
+from azure.ai.ml._restclient.v2023_10_01.models import Feature as RestFeature
+from azure.ai.ml._restclient.v2023_10_01.models import FeatureProperties
+from azure.ai.ml.entities._feature_store_entity.data_column_type import DataColumnType
+from azure.ai.ml.entities._mixins import RestTranslatableMixin
+
+
+class Feature(RestTranslatableMixin):
+    """Feature
+
+    :param name: The name of the feature.
+    :type name: str
+    :param data_type: The data type of the feature.
+    :type data_type: ~azure.ai.ml.entities.DataColumnType
+    :param description: The description of the feature. Defaults to None.
+    :type description: Optional[str]
+    :param tags: Tag dictionary. Tags can be added, removed, and updated. Defaults to None.
+    :type tags: Optional[dict[str, str]]
+    :param kwargs: A dictionary of additional configuration parameters.
+    :type kwargs: dict
+    """
+
+    def __init__(
+        self,
+        *,
+        name: str,
+        data_type: DataColumnType,
+        description: Optional[str] = None,
+        tags: Optional[Dict[str, str]] = None,
+        **kwargs: Any
+    ):
+        self.name = name
+        self.data_type = data_type
+        self.description = description
+        self.tags = tags
+
+    @classmethod
+    def _from_rest_object(cls, obj: RestFeature) -> Optional["Feature"]:
+        if not obj:
+            return None
+        feature_rest_object_details: FeatureProperties = obj.properties
+        return Feature(
+            name=feature_rest_object_details.feature_name,
+            data_type=feature_rest_object_details.data_type,
+            description=feature_rest_object_details.description,
+            tags=feature_rest_object_details.tags,
+        )