Skip to content

Commit 2c6d1f2

Browse files
committed
black formatted
1 parent 6126720 commit 2c6d1f2

File tree

4 files changed

+26
-27
lines changed

4 files changed

+26
-27
lines changed

ads/feature_store/common/utils/utility.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050

5151
def get_execution_engine_type(
52-
data_frame: Union[DataFrame, pd.DataFrame]
52+
data_frame: Union[DataFrame, pd.DataFrame]
5353
) -> ExecutionEngine:
5454
"""
5555
Determines the execution engine type for a given DataFrame.
@@ -89,7 +89,7 @@ def get_metastore_id(feature_store_id: str):
8989

9090

9191
def validate_delta_format_parameters(
92-
timestamp: datetime = None, version_number: int = None, is_restore: bool = False
92+
timestamp: datetime = None, version_number: int = None, is_restore: bool = False
9393
):
9494
"""
9595
Validate the user input provided as part of preview, restore APIs for ingested data, Ingested data is
@@ -123,9 +123,9 @@ def validate_delta_format_parameters(
123123

124124

125125
def show_ingestion_summary(
126-
entity_id: str,
127-
entity_type: EntityType = EntityType.FEATURE_GROUP,
128-
error_details: str = None,
126+
entity_id: str,
127+
entity_type: EntityType = EntityType.FEATURE_GROUP,
128+
error_details: str = None,
129129
):
130130
"""
131131
Displays a ingestion summary table with the given entity type and error details.
@@ -165,7 +165,7 @@ def show_validation_summary(ingestion_status: str, validation_output, expectatio
165165
statistics = validation_output["statistics"]
166166

167167
table_headers = (
168-
["expectation_type"] + list(statistics.keys()) + ["ingestion_status"]
168+
["expectation_type"] + list(statistics.keys()) + ["ingestion_status"]
169169
)
170170

171171
table_values = [expectation_type] + list(statistics.values()) + [ingestion_status]
@@ -209,9 +209,9 @@ def show_validation_summary(ingestion_status: str, validation_output, expectatio
209209

210210

211211
def get_features(
212-
output_columns: List[dict],
213-
parent_id: str,
214-
entity_type: EntityType = EntityType.FEATURE_GROUP,
212+
output_columns: List[dict],
213+
parent_id: str,
214+
entity_type: EntityType = EntityType.FEATURE_GROUP,
215215
) -> List[Feature]:
216216
"""
217217
Returns a list of features, given a list of output_columns and a feature_group_id.
@@ -268,7 +268,7 @@ def get_schema_from_spark_df(df: DataFrame):
268268

269269

270270
def get_schema_from_df(
271-
data_frame: Union[DataFrame, pd.DataFrame], feature_store_id: str
271+
data_frame: Union[DataFrame, pd.DataFrame], feature_store_id: str
272272
) -> List[dict]:
273273
"""
274274
Given a DataFrame, returns a list of dictionaries that describe its schema.
@@ -282,7 +282,7 @@ def get_schema_from_df(
282282

283283

284284
def get_input_features_from_df(
285-
data_frame: Union[DataFrame, pd.DataFrame], feature_store_id: str
285+
data_frame: Union[DataFrame, pd.DataFrame], feature_store_id: str
286286
) -> List[FeatureDetail]:
287287
"""
288288
Given a DataFrame, returns a list of FeatureDetail objects that represent its input features.
@@ -299,7 +299,7 @@ def get_input_features_from_df(
299299

300300

301301
def convert_expectation_suite_to_expectation(
302-
expectation_suite: ExpectationSuite, expectation_type: ExpectationType
302+
expectation_suite: ExpectationSuite, expectation_type: ExpectationType
303303
):
304304
"""
305305
Convert an ExpectationSuite object to an Expectation object with detailed rule information.
@@ -358,7 +358,7 @@ def largest_matching_subset_of_primary_keys(left_feature_group, right_feature_gr
358358

359359

360360
def convert_pandas_datatype_with_schema(
361-
raw_feature_details: List[dict], input_df: pd.DataFrame
361+
raw_feature_details: List[dict], input_df: pd.DataFrame
362362
) -> pd.DataFrame:
363363
feature_detail_map = {}
364364
columns_to_remove = []
@@ -383,7 +383,7 @@ def convert_pandas_datatype_with_schema(
383383

384384

385385
def convert_spark_dataframe_with_schema(
386-
raw_feature_details: List[dict], input_df: DataFrame
386+
raw_feature_details: List[dict], input_df: DataFrame
387387
) -> DataFrame:
388388
feature_detail_map = {}
389389
columns_to_remove = []
@@ -402,4 +402,4 @@ def convert_spark_dataframe_with_schema(
402402
def validate_input_feature_details(input_feature_details, data_frame):
403403
if isinstance(data_frame, pd.DataFrame):
404404
return convert_pandas_datatype_with_schema(input_feature_details, data_frame)
405-
return convert_spark_dataframe_with_schema(input_feature_details, data_frame)
405+
return convert_spark_dataframe_with_schema(input_feature_details, data_frame)

ads/feature_store/dataset.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from ads.feature_store.common.utils.utility import (
1919
get_metastore_id,
2020
validate_delta_format_parameters,
21-
convert_expectation_suite_to_expectation
21+
convert_expectation_suite_to_expectation,
2222
)
2323
from ads.feature_store.dataset_job import DatasetJob, IngestionMode
2424
from ads.feature_store.execution_strategy.engine.spark_engine import SparkEngine
@@ -374,7 +374,7 @@ def expectation_details(self) -> "Expectation":
374374
return self.get_spec(self.CONST_EXPECTATION_DETAILS)
375375

376376
def with_expectation_suite(
377-
self, expectation_suite: ExpectationSuite, expectation_type: ExpectationType
377+
self, expectation_suite: ExpectationSuite, expectation_type: ExpectationType
378378
) -> "Dataset":
379379
"""Sets the expectation details for the feature group.
380380
@@ -445,7 +445,7 @@ def statistics_config(self, statistics_config: StatisticsConfig):
445445
self.with_statistics_config(statistics_config)
446446

447447
def with_statistics_config(
448-
self, statistics_config: Union[StatisticsConfig, bool]
448+
self, statistics_config: Union[StatisticsConfig, bool]
449449
) -> "Dataset":
450450
"""Sets the statistics details for the dataset.
451451
@@ -527,7 +527,9 @@ def add_models(self, model_details: ModelDetails) -> "Dataset":
527527
if updated_model_details and updated_model_details.items and model_details:
528528
for model_id in model_details.items:
529529
if model_id not in updated_model_details["items"]:
530-
logger.warning(f"Either model with Id '{model_id}' doesnt exist or unable to validate")
530+
logger.warning(
531+
f"Either model with Id '{model_id}' doesnt exist or unable to validate"
532+
)
531533

532534
return self
533535

ads/feature_store/mixin/oci_feature_store.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class OCIFeatureStoreMixin(OCIModelMixin):
1414
def init_client(
1515
cls, **kwargs
1616
) -> oci.feature_store.feature_store_client.FeatureStoreClient:
17-
1817
# TODO: Getting the endpoint from authorizer
1918
fs_service_endpoint = os.environ.get("OCI_FS_SERVICE_ENDPOINT")
2019
if fs_service_endpoint:

ads/feature_store/validation_output.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ def to_pandas(self) -> pd.DataFrame:
2323
The validation output information as a pandas DataFrame.
2424
"""
2525
if self.content:
26-
validation_output_json = (
27-
json.loads(self.content)
28-
)
29-
profile_result = pd.json_normalize(validation_output_json.get("results")).transpose()
26+
validation_output_json = json.loads(self.content)
27+
profile_result = pd.json_normalize(
28+
validation_output_json.get("results")
29+
).transpose()
3030
return profile_result
3131

3232
def to_summary(self) -> pd.DataFrame:
@@ -39,9 +39,7 @@ def to_summary(self) -> pd.DataFrame:
3939
The validation output summary information as a pandas DataFrame.
4040
"""
4141
if self.content:
42-
validation_output_json = (
43-
json.loads(self.content)
44-
)
42+
validation_output_json = json.loads(self.content)
4543
profile_result = pd.json_normalize(validation_output_json).transpose()
4644
summary_df = profile_result.drop("results")
4745
return summary_df

0 commit comments

Comments
 (0)