MCPcopy Index your code
hub / github.com/feast-dev/feast / KinesisOptions

Class KinesisOptions

sdk/python/feast/data_source.py:100–149  ·  view source on GitHub ↗

DataSource Kinesis options used to source features from Kinesis records

Source from the content-addressed store, hash-verified

98
99
100class KinesisOptions:
101 """
102 DataSource Kinesis options used to source features from Kinesis records
103 """
104
105 def __init__(
106 self,
107 record_format: StreamFormat,
108 region: str,
109 stream_name: str,
110 ):
111 self.record_format = record_format
112 self.region = region
113 self.stream_name = stream_name
114
115 @classmethod
116 def from_proto(cls, kinesis_options_proto: DataSourceProto.KinesisOptions):
117 """
118 Creates a KinesisOptions from a protobuf representation of a kinesis option
119
120 Args:
121 kinesis_options_proto: A protobuf representation of a DataSource
122
123 Returns:
124 Returns a KinesisOptions object based on the kinesis_options protobuf
125 """
126
127 kinesis_options = cls(
128 record_format=StreamFormat.from_proto(kinesis_options_proto.record_format),
129 region=kinesis_options_proto.region,
130 stream_name=kinesis_options_proto.stream_name,
131 )
132
133 return kinesis_options
134
135 def to_proto(self) -> DataSourceProto.KinesisOptions:
136 """
137 Converts an KinesisOptionsProto object to its protobuf representation.
138
139 Returns:
140 KinesisOptionsProto protobuf
141 """
142
143 kinesis_options_proto = DataSourceProto.KinesisOptions(
144 record_format=self.record_format.to_proto(),
145 region=self.region,
146 stream_name=self.stream_name,
147 )
148
149 return kinesis_options_proto
150
151
152_DATA_SOURCE_OPTIONS = {

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected