Creates a KafkaSource object. Args: name: Name of data source, which should be unique within a project timestamp_field: Event timestamp field used for point-in-time joins of feature values. message_format: StreamFormat of serialized messages.
(
self,
*,
name: str,
timestamp_field: str,
message_format: StreamFormat,
bootstrap_servers: Optional[str] = None,
kafka_bootstrap_servers: Optional[str] = None,
topic: Optional[str] = None,
created_timestamp_column: Optional[str] = "",
field_mapping: Optional[Dict[str, str]] = None,
description: Optional[str] = "",
tags: Optional[Dict[str, str]] = None,
owner: Optional[str] = "",
batch_source: Optional[DataSource] = None,
watermark_delay_threshold: Optional[timedelta] = None,
)
| 427 | """A KafkaSource allow users to register Kafka streams as data sources.""" |
| 428 | |
| 429 | def __init__( |
| 430 | self, |
| 431 | *, |
| 432 | name: str, |
| 433 | timestamp_field: str, |
| 434 | message_format: StreamFormat, |
| 435 | bootstrap_servers: Optional[str] = None, |
| 436 | kafka_bootstrap_servers: Optional[str] = None, |
| 437 | topic: Optional[str] = None, |
| 438 | created_timestamp_column: Optional[str] = "", |
| 439 | field_mapping: Optional[Dict[str, str]] = None, |
| 440 | description: Optional[str] = "", |
| 441 | tags: Optional[Dict[str, str]] = None, |
| 442 | owner: Optional[str] = "", |
| 443 | batch_source: Optional[DataSource] = None, |
| 444 | watermark_delay_threshold: Optional[timedelta] = None, |
| 445 | ): |
| 446 | """ |
| 447 | Creates a KafkaSource object. |
| 448 | |
| 449 | Args: |
| 450 | name: Name of data source, which should be unique within a project |
| 451 | timestamp_field: Event timestamp field used for point-in-time joins of feature values. |
| 452 | message_format: StreamFormat of serialized messages. |
| 453 | bootstrap_servers: (Deprecated) The servers of the kafka broker in the form "localhost:9092". |
| 454 | kafka_bootstrap_servers (optional): The servers of the kafka broker in the form "localhost:9092". |
| 455 | topic (optional): The name of the topic to read from in the kafka source. |
| 456 | created_timestamp_column (optional): Timestamp column indicating when the row |
| 457 | was created, used for deduplicating rows. |
| 458 | field_mapping (optional): A dictionary mapping of column names in this data |
| 459 | source to feature names in a feature table or view. Only used for feature |
| 460 | columns, not entity or timestamp columns. |
| 461 | description (optional): A human-readable description. |
| 462 | tags (optional): A dictionary of key-value pairs to store arbitrary metadata. |
| 463 | owner (optional): The owner of the data source, typically the email of the primary |
| 464 | maintainer. |
| 465 | batch_source (optional): The datasource that acts as a batch source. |
| 466 | watermark_delay_threshold (optional): The watermark delay threshold for stream data. |
| 467 | Specifically how late stream data can arrive without being discarded. |
| 468 | """ |
| 469 | if bootstrap_servers: |
| 470 | warnings.warn( |
| 471 | ( |
| 472 | "The 'bootstrap_servers' parameter has been deprecated in favor of 'kafka_bootstrap_servers'. " |
| 473 | "Feast 0.25 and onwards will not support the 'bootstrap_servers' parameter." |
| 474 | ), |
| 475 | DeprecationWarning, |
| 476 | ) |
| 477 | |
| 478 | super().__init__( |
| 479 | name=name, |
| 480 | timestamp_field=timestamp_field, |
| 481 | created_timestamp_column=created_timestamp_column, |
| 482 | field_mapping=field_mapping, |
| 483 | description=description, |
| 484 | tags=tags, |
| 485 | owner=owner, |
| 486 | ) |
nothing calls this directly
no test coverage detected