File tree Expand file tree Collapse file tree
tensorflow_data_validation/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,19 +175,19 @@ def set_domain(
175175 if feature .WhichOneof ("domain_info" ) is not None :
176176 logging .warning ('Replacing existing domain of feature "%s".' , feature_path )
177177
178- for d_type , d_name in feature_domains .items ():
179- if isinstance (domain , d_type ):
180- if d_type is str :
181- found_domain = False
182- for global_domain in schema .string_domain :
183- if global_domain .name == domain :
184- found_domain = True
185- break
186- if not found_domain :
187- raise ValueError (f'Invalid global string domain "{ domain } ".' )
188- feature .domain = domain
189- else :
190- getattr (feature , d_name ).CopyFrom (domain )
178+ for d_type , d_name in feature_domains .items ():
179+ if isinstance (domain , d_type ):
180+ if d_type is str :
181+ found_domain = False
182+ for global_domain in schema .string_domain :
183+ if global_domain .name == domain :
184+ found_domain = True
185+ break
186+ if not found_domain :
187+ raise ValueError (f'Invalid global string domain "{ domain } ".' )
188+ feature .domain = domain
189+ else :
190+ getattr (feature , d_name ).CopyFrom (domain )
191191
192192
193193def write_schema_text (schema : schema_pb2 .Schema , output_path : str ) -> None :
You can’t perform that action at this time.
0 commit comments