@@ -50,12 +50,12 @@ class KafkaOptions:
5050
5151 def __init__ (
5252 self ,
53- bootstrap_servers : str ,
53+ kafka_bootstrap_servers : str ,
5454 message_format : StreamFormat ,
5555 topic : str ,
5656 watermark : Optional [timedelta ] = None ,
5757 ):
58- self .bootstrap_servers = bootstrap_servers
58+ self .kafka_bootstrap_servers = kafka_bootstrap_servers
5959 self .message_format = message_format
6060 self .topic = topic
6161 self .watermark = watermark or None
@@ -79,7 +79,7 @@ def from_proto(cls, kafka_options_proto: DataSourceProto.KafkaOptions):
7979 else kafka_options_proto .watermark .ToTimedelta ()
8080 )
8181 kafka_options = cls (
82- bootstrap_servers = kafka_options_proto .bootstrap_servers ,
82+ kafka_bootstrap_servers = kafka_options_proto .kafka_bootstrap_servers ,
8383 message_format = StreamFormat .from_proto (kafka_options_proto .message_format ),
8484 topic = kafka_options_proto .topic ,
8585 watermark = watermark ,
@@ -100,7 +100,7 @@ def to_proto(self) -> DataSourceProto.KafkaOptions:
100100 watermark_duration .FromTimedelta (self .watermark )
101101
102102 kafka_options_proto = DataSourceProto .KafkaOptions (
103- bootstrap_servers = self .bootstrap_servers ,
103+ kafka_bootstrap_servers = self .kafka_bootstrap_servers ,
104104 message_format = self .message_format .to_proto (),
105105 topic = self .topic ,
106106 watermark = watermark_duration ,
@@ -364,20 +364,13 @@ def get_table_query_string(self) -> str:
364364
365365
366366class KafkaSource (DataSource ):
367- def validate (self , config : RepoConfig ):
368- pass
369-
370- def get_table_column_names_and_types (
371- self , config : RepoConfig
372- ) -> Iterable [Tuple [str , str ]]:
373- pass
374-
375367 def __init__ (
376368 self ,
377369 * args ,
378370 name : Optional [str ] = None ,
379371 event_timestamp_column : Optional [str ] = "" ,
380372 bootstrap_servers : Optional [str ] = None ,
373+ kafka_bootstrap_servers : Optional [str ] = None ,
381374 message_format : Optional [StreamFormat ] = None ,
382375 topic : Optional [str ] = None ,
383376 created_timestamp_column : Optional [str ] = "" ,
@@ -391,28 +384,30 @@ def __init__(
391384 watermark : Optional [timedelta ] = None ,
392385 ):
393386 """
394- Creates a KafkaSource stream source object.
387+ Creates a KafkaSource object.
388+
395389 Args:
396- name: str. Name of data source, which should be unique within a project
397- event_timestamp_column (optional): str. (Deprecated) Event timestamp column used for point in time
390+ name: Name of data source, which should be unique within a project
391+ event_timestamp_column: (Deprecated) Event timestamp column used for point in time
398392 joins of feature values.
399- bootstrap_servers: str. The servers of the kafka broker in the form "localhost:9092".
400- message_format: StreamFormat. StreamFormat of serialized messages.
401- topic: str. The name of the topic to read from in the kafka source.
402- created_timestamp_column (optional): str. Timestamp column indicating when the row
393+ bootstrap_servers: (Deprecated) The servers of the kafka broker in the form "localhost:9092".
394+ kafka_bootstrap_servers: The servers of the kafka broker in the form "localhost:9092".
395+ message_format: StreamFormat of serialized messages.
396+ topic: The name of the topic to read from in the kafka source.
397+ created_timestamp_column (optional): Timestamp column indicating when the row
403398 was created, used for deduplicating rows.
404- field_mapping (optional): dict(str, str). A dictionary mapping of column names in this data
399+ field_mapping (optional): A dictionary mapping of column names in this data
405400 source to feature names in a feature table or view. Only used for feature
406401 columns, not entity or timestamp columns.
407- date_partition_column (optional): str. Timestamp column used for partitioning.
408- description (optional): str. A human-readable description.
409- tags (optional): dict(str, str). A dictionary of key-value pairs to store arbitrary metadata.
410- owner (optional): str. The owner of the data source, typically the email of the primary
402+ date_partition_column (optional): Timestamp column used for partitioning.
403+ description (optional): A human-readable description.
404+ tags (optional): A dictionary of key-value pairs to store arbitrary metadata.
405+ owner (optional): The owner of the data source, typically the email of the primary
411406 maintainer.
412- timestamp_field (optional): str. Event timestamp field used for point
407+ timestamp_field (optional): Event timestamp field used for point
413408 in time joins of feature values.
414- batch_source: DataSource. The datasource that acts as a batch source.
415- watermark: timedelta. The watermark for stream data. Specifically how late stream data can arrive without being discarded.
409+ batch_source: The datasource that acts as a batch source.
410+ watermark: The watermark for stream data. Specifically how late stream data can arrive without being discarded.
416411 """
417412 positional_attributes = [
418413 "name" ,
@@ -423,10 +418,19 @@ def __init__(
423418 ]
424419 _name = name
425420 _event_timestamp_column = event_timestamp_column
426- _bootstrap_servers = bootstrap_servers or ""
421+ _kafka_bootstrap_servers = kafka_bootstrap_servers or bootstrap_servers or ""
427422 _message_format = message_format
428423 _topic = topic or ""
429424
425+ if bootstrap_servers :
426+ warnings .warn (
427+ (
428+ "The 'bootstrap_servers' parameter has been deprecated in favor of 'kafka_bootstrap_servers'. "
429+ "Feast 0.25 and onwards will not support the 'bootstrap_servers' parameter."
430+ ),
431+ DeprecationWarning ,
432+ )
433+
430434 if args :
431435 warnings .warn (
432436 (
@@ -445,7 +449,7 @@ def __init__(
445449 if len (args ) >= 2 :
446450 _event_timestamp_column = args [1 ]
447451 if len (args ) >= 3 :
448- _bootstrap_servers = args [2 ]
452+ _kafka_bootstrap_servers = args [2 ]
449453 if len (args ) >= 4 :
450454 _message_format = args [3 ]
451455 if len (args ) >= 5 :
@@ -471,7 +475,7 @@ def __init__(
471475 self .batch_source = batch_source
472476
473477 self .kafka_options = KafkaOptions (
474- bootstrap_servers = _bootstrap_servers ,
478+ kafka_bootstrap_servers = _kafka_bootstrap_servers ,
475479 message_format = _message_format ,
476480 topic = _topic ,
477481 watermark = watermark ,
@@ -487,8 +491,8 @@ def __eq__(self, other):
487491 return False
488492
489493 if (
490- self .kafka_options .bootstrap_servers
491- != other .kafka_options .bootstrap_servers
494+ self .kafka_options .kafka_bootstrap_servers
495+ != other .kafka_options .kafka_bootstrap_servers
492496 or self .kafka_options .message_format != other .kafka_options .message_format
493497 or self .kafka_options .topic != other .kafka_options .topic
494498 or self .kafka_options .watermark != other .kafka_options .watermark
@@ -513,7 +517,7 @@ def from_proto(data_source: DataSourceProto):
513517 name = data_source .name ,
514518 event_timestamp_column = data_source .timestamp_field ,
515519 field_mapping = dict (data_source .field_mapping ),
516- bootstrap_servers = data_source .kafka_options .bootstrap_servers ,
520+ kafka_bootstrap_servers = data_source .kafka_options .kafka_bootstrap_servers ,
517521 message_format = StreamFormat .from_proto (
518522 data_source .kafka_options .message_format
519523 ),
@@ -548,6 +552,14 @@ def to_proto(self) -> DataSourceProto:
548552 data_source_proto .batch_source .MergeFrom (self .batch_source .to_proto ())
549553 return data_source_proto
550554
555+ def validate (self , config : RepoConfig ):
556+ pass
557+
558+ def get_table_column_names_and_types (
559+ self , config : RepoConfig
560+ ) -> Iterable [Tuple [str , str ]]:
561+ pass
562+
551563 @staticmethod
552564 def source_datatype_to_feast_value_type () -> Callable [[str ], ValueType ]:
553565 return type_map .redshift_to_feast_value_type
0 commit comments