MCPcopy
hub / github.com/feast-dev/feast / to_proto

Method to_proto

sdk/python/feast/data_source.py:78–97  ·  view source on GitHub ↗

Converts an KafkaOptionsProto object to its protobuf representation. Returns: KafkaOptionsProto protobuf

(self)

Source from the content-addressed store, hash-verified

76 return kafka_options
77
78 def to_proto(self) -> DataSourceProto.KafkaOptions:
79 """
80 Converts an KafkaOptionsProto object to its protobuf representation.
81
82 Returns:
83 KafkaOptionsProto protobuf
84 """
85 watermark_delay_threshold = None
86 if self.watermark_delay_threshold is not None:
87 watermark_delay_threshold = Duration()
88 watermark_delay_threshold.FromTimedelta(self.watermark_delay_threshold)
89
90 kafka_options_proto = DataSourceProto.KafkaOptions(
91 kafka_bootstrap_servers=self.kafka_bootstrap_servers,
92 message_format=self.message_format.to_proto(),
93 topic=self.topic,
94 watermark_delay_threshold=watermark_delay_threshold,
95 )
96
97 return kafka_options_proto
98
99
100class KinesisOptions:

Callers

nothing calls this directly

Calls 1

to_protoMethod · 0.45

Tested by

no test coverage detected