1515import json
1616from abc import ABC , abstractmethod
1717from enum import Enum
18- from typing import Dict , Optional , TYPE_CHECKING
18+ from typing import TYPE_CHECKING , Dict , Optional
1919
2020if TYPE_CHECKING :
2121 from feast .protos .feast .core .DataFormat_pb2 import TableFormat as TableFormatProto
@@ -171,7 +171,9 @@ def from_dict(cls, data: Dict) -> "IcebergFormat":
171171
172172 def to_proto (self ) -> "TableFormatProto" :
173173 """Convert to protobuf TableFormat message"""
174- from feast .protos .feast .core .DataFormat_pb2 import TableFormat as TableFormatProto
174+ from feast .protos .feast .core .DataFormat_pb2 import (
175+ TableFormat as TableFormatProto ,
176+ )
175177
176178 iceberg_proto = TableFormatProto .IcebergFormat (
177179 catalog = self .catalog or "" ,
@@ -268,7 +270,9 @@ def from_dict(cls, data: Dict) -> "DeltaFormat":
268270
269271 def to_proto (self ) -> "TableFormatProto" :
270272 """Convert to protobuf TableFormat message"""
271- from feast .protos .feast .core .DataFormat_pb2 import TableFormat as TableFormatProto
273+ from feast .protos .feast .core .DataFormat_pb2 import (
274+ TableFormat as TableFormatProto ,
275+ )
272276
273277 delta_proto = TableFormatProto .DeltaFormat (
274278 checkpoint_location = self .checkpoint_location or "" ,
@@ -281,7 +285,9 @@ def from_proto(cls, proto: "TableFormatProto") -> "DeltaFormat":
281285 """Create from protobuf TableFormat message"""
282286 delta_proto = proto .delta_format
283287 return cls (
284- checkpoint_location = delta_proto .checkpoint_location if delta_proto .checkpoint_location else None ,
288+ checkpoint_location = delta_proto .checkpoint_location
289+ if delta_proto .checkpoint_location
290+ else None ,
285291 properties = dict (delta_proto .properties ),
286292 )
287293
@@ -390,7 +396,9 @@ def from_dict(cls, data: Dict) -> "HudiFormat":
390396
391397 def to_proto (self ) -> "TableFormatProto" :
392398 """Convert to protobuf TableFormat message"""
393- from feast .protos .feast .core .DataFormat_pb2 import TableFormat as TableFormatProto
399+ from feast .protos .feast .core .DataFormat_pb2 import (
400+ TableFormat as TableFormatProto ,
401+ )
394402
395403 hudi_proto = TableFormatProto .HudiFormat (
396404 table_type = self .table_type or "" ,
@@ -407,7 +415,9 @@ def from_proto(cls, proto: "TableFormatProto") -> "HudiFormat":
407415 return cls (
408416 table_type = hudi_proto .table_type if hudi_proto .table_type else None ,
409417 record_key = hudi_proto .record_key if hudi_proto .record_key else None ,
410- precombine_field = hudi_proto .precombine_field if hudi_proto .precombine_field else None ,
418+ precombine_field = hudi_proto .precombine_field
419+ if hudi_proto .precombine_field
420+ else None ,
411421 properties = dict (hudi_proto .properties ),
412422 )
413423
@@ -541,7 +551,6 @@ def table_format_from_proto(proto: "TableFormatProto") -> TableFormat:
541551 Raises:
542552 ValueError: If the proto doesn't contain a recognized format.
543553 """
544- from feast .protos .feast .core .DataFormat_pb2 import TableFormat as TableFormatProto
545554
546555 which_format = proto .WhichOneof ("format" )
547556
0 commit comments