RequestSource that can be used to provide input features for on demand transforms Attributes: name: Name of the request data source schema: Schema mapping from the input feature name to a ValueType description: A human-readable description. tags: A dictionar
| 590 | |
| 591 | @typechecked |
| 592 | class RequestSource(DataSource): |
| 593 | """ |
| 594 | RequestSource that can be used to provide input features for on demand transforms |
| 595 | |
| 596 | Attributes: |
| 597 | name: Name of the request data source |
| 598 | schema: Schema mapping from the input feature name to a ValueType |
| 599 | description: A human-readable description. |
| 600 | tags: A dictionary of key-value pairs to store arbitrary metadata. |
| 601 | owner: The owner of the request data source, typically the email of the primary |
| 602 | maintainer. |
| 603 | """ |
| 604 | |
| 605 | name: str |
| 606 | schema: List[Field] |
| 607 | description: str |
| 608 | tags: Dict[str, str] |
| 609 | owner: str |
| 610 | |
| 611 | def __init__( |
| 612 | self, |
| 613 | *, |
| 614 | name: str, |
| 615 | schema: List[Field], |
| 616 | timestamp_field: Optional[str] = None, |
| 617 | description: Optional[str] = "", |
| 618 | tags: Optional[Dict[str, str]] = None, |
| 619 | owner: Optional[str] = "", |
| 620 | ): |
| 621 | """Creates a RequestSource object.""" |
| 622 | super().__init__( |
| 623 | name=name, |
| 624 | timestamp_field=timestamp_field, |
| 625 | description=description, |
| 626 | tags=tags, |
| 627 | owner=owner, |
| 628 | ) |
| 629 | self.schema = schema |
| 630 | |
| 631 | def validate(self, config: RepoConfig): |
| 632 | raise NotImplementedError |
| 633 | |
| 634 | def get_table_column_names_and_types( |
| 635 | self, config: RepoConfig |
| 636 | ) -> Iterable[Tuple[str, str]]: |
| 637 | raise NotImplementedError |
| 638 | |
| 639 | def __eq__(self, other): |
| 640 | if not isinstance(other, RequestSource): |
| 641 | raise TypeError( |
| 642 | "Comparisons should only involve RequestSource class objects." |
| 643 | ) |
| 644 | |
| 645 | if not super().__eq__(other): |
| 646 | return False |
| 647 | |
| 648 | if isinstance(self.schema, List) and isinstance(other.schema, List): |
| 649 | for field1, field2 in zip(self.schema, other.schema): |
no outgoing calls