Skip to content

Commit 9bb9800

Browse files
committed
'fix minor bugs
1 parent 90855ee commit 9bb9800

File tree

3 files changed

+9
-27
lines changed

3 files changed

+9
-27
lines changed

ads/feature_store/dataset.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from ads.feature_store.execution_strategy.execution_strategy_provider import (
2929
OciExecutionStrategyProvider,
3030
)
31-
from ads.feature_store.feature import Feature
3231
from ads.feature_store.feature import DatasetFeature
3332
from ads.feature_store.feature_group_expectation import Expectation
3433
from ads.feature_store.feature_option_details import FeatureOptionDetails
@@ -247,7 +246,7 @@ def id(self) -> str:
247246
return self.get_spec(self.CONST_ID)
248247

249248
@property
250-
def features(self) -> List[Feature]:
249+
def features(self) -> List[DatasetFeature]:
251250
return [
252251
DatasetFeature(**feature_dict)
253252
for feature_dict in self.get_spec(self.CONST_OUTPUT_FEATURE_DETAILS)[
@@ -259,7 +258,6 @@ def features(self) -> List[Feature]:
259258
def with_id(self, id: str) -> "Dataset":
260259
return self.set_spec(self.CONST_ID, id)
261260

262-
263261
def with_job_id(self, dataset_job_id: str) -> "Dataset":
264262
"""Sets the job_id for the last running job.
265263
@@ -721,12 +719,12 @@ def delete(self):
721719

722720
dataset_execution_strategy.delete_dataset(self, dataset_job)
723721

724-
def get_features(self) -> List[Feature]:
722+
def get_features(self) -> List[DatasetFeature]:
725723
"""
726724
Returns all the features in the dataset.
727725
728726
Returns:
729-
List[Feature]
727+
List[DatasetFeature]
730728
"""
731729

732730
return self.features
@@ -740,13 +738,9 @@ def get_features_df(self) -> "pandas.DataFrame":
740738
"""
741739
records = []
742740
for feature in self.features:
743-
records.append(
744-
{
745-
"name": feature.feature_name,
746-
"type": feature.feature_type
747-
}
748-
)
741+
records.append({"name": feature.feature_name, "type": feature.feature_type})
749742
return pandas.DataFrame.from_records(records)
743+
750744
def update(self, **kwargs) -> "Dataset":
751745
"""Updates Dataset in the feature store.
752746
@@ -794,9 +788,7 @@ def _update_from_oci_dataset_model(self, oci_dataset: OCIDataset) -> "Dataset":
794788
# May not need if we fix the backend and add feature_group_id to the output_feature
795789
features_list = []
796790
for output_feature in dataset_details[infra_attr]["items"]:
797-
output_feature["datasetId"] = dataset_details[
798-
self.CONST_ID
799-
]
791+
output_feature["datasetId"] = dataset_details[self.CONST_ID]
800792
features_list.append(output_feature)
801793

802794
value = {self.CONST_ITEMS: features_list}

ads/feature_store/docs/source/dataset.rst

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,23 +227,14 @@ The ``get_statistics()`` method takes the following optional parameter:
227227

228228
Get features
229229
============
230-
You can call the ``get_features_dataframe()`` method of the Dataset instance to fetch features in a dataset.
230+
You can call the ``get_features_df()`` method of the Dataset instance to fetch features in a dataset.
231231

232232
.. code-block:: python3
233233
234234
# Fetch features for a dataset
235-
df = dataset.get_features_dataframe()
235+
df = dataset.get_features_df()
236236
df.show()
237237
238-
Get input schema details
239-
========================
240-
You can call the ``get_input_schema_dataframe()`` method of the Dataset instance to fetch input schema details of a dataset.
241-
242-
.. code-block:: python3
243-
244-
# Fetch input schema details for a dataset
245-
df = dataset.get_input_schema_dataframe()
246-
df.show()
247238
248239
Preview
249240
========

ads/feature_store/feature_group.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,7 @@ def get_features_df(self) -> "pd.DataFrame":
753753
records.append(
754754
{
755755
"name": feature.feature_name,
756-
"type": feature.feature_type,
757-
"feature_group_id": feature.feature_group_id,
756+
"type": feature.feature_type
758757
}
759758
)
760759
return pd.DataFrame.from_records(records)

0 commit comments

Comments
 (0)