11#!/usr/bin/env python
22# -*- coding: utf-8; -*-
3- import json
4-
53# Copyright (c) 2023 Oracle and/or its affiliates.
64# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
75
2927 raise
3028
3129from ads .feature_store .common .enums import (
32- FeatureStoreJobType ,
33- LifecycleState ,
3430 EntityType ,
3531 ExpectationType ,
3632)
4743
4844from ads .feature_store .feature_statistics .statistics_service import StatisticsService
4945from ads .feature_store .common .utils .utility import validate_input_feature_details
46+ from typing import TYPE_CHECKING
47+
48+ if TYPE_CHECKING :
49+ from ads .feature_store .feature_group import FeatureGroup
50+ from ads .feature_store .dataset import Dataset
5051
5152logger = logging .getLogger (__name__ )
5253
@@ -76,7 +77,10 @@ def __init__(self, metastore_id: str = None):
7677 self ._jvm = self ._spark_context ._jvm
7778
7879 def ingest_feature_definition (
79- self , feature_group , feature_group_job : FeatureGroupJob , dataframe
80+ self ,
81+ feature_group : "FeatureGroup" ,
82+ feature_group_job : FeatureGroupJob ,
83+ dataframe ,
8084 ):
8185 try :
8286 self ._save_offline_dataframe (dataframe , feature_group , feature_group_job )
@@ -90,7 +94,7 @@ def ingest_dataset(self, dataset, dataset_job: DatasetJob):
9094 raise SparkExecutionException (e ).with_traceback (e .__traceback__ )
9195
9296 def delete_feature_definition (
93- self , feature_group , feature_group_job : FeatureGroupJob
97+ self , feature_group : "FeatureGroup" , feature_group_job : FeatureGroupJob
9498 ):
9599 """
96100 Deletes a feature definition from the system.
@@ -122,7 +126,7 @@ def delete_feature_definition(
122126 output_details = output_details ,
123127 )
124128
125- def delete_dataset (self , dataset , dataset_job : DatasetJob ):
129+ def delete_dataset (self , dataset : "Dataset" , dataset_job : DatasetJob ):
126130 """
127131 Deletes a dataset from the system.
128132
@@ -154,7 +158,7 @@ def delete_dataset(self, dataset, dataset_job: DatasetJob):
154158 )
155159
156160 @staticmethod
157- def _validate_expectation (expectation_type , validation_output ):
161+ def _validate_expectation (expectation_type , validation_output : dict ):
158162 """
159163 Validates the expectation based on the given expectation type and the validation output.
160164
0 commit comments