A source that can be used to ingest features on request
| 849 | |
| 850 | @typechecked |
| 851 | class PushSource(DataSource): |
| 852 | """ |
| 853 | A source that can be used to ingest features on request |
| 854 | """ |
| 855 | |
| 856 | # TODO(adchia): consider adding schema here in case where Feast manages pushing events to the offline store |
| 857 | # TODO(adchia): consider a "mode" to support pushing raw vs transformed events |
| 858 | batch_source: Optional[DataSource] = None |
| 859 | |
| 860 | def __init__( |
| 861 | self, |
| 862 | *, |
| 863 | name: str, |
| 864 | batch_source: Optional[DataSource] = None, |
| 865 | description: Optional[str] = "", |
| 866 | tags: Optional[Dict[str, str]] = None, |
| 867 | owner: Optional[str] = "", |
| 868 | ): |
| 869 | """ |
| 870 | Creates a PushSource object. |
| 871 | |
| 872 | Args: |
| 873 | name: Name of the push source |
| 874 | batch_source: The batch source that backs this push source. It's used when materializing from the offline |
| 875 | store to the online store, and when retrieving historical features. |
| 876 | description (optional): A human-readable description. |
| 877 | tags (optional): A dictionary of key-value pairs to store arbitrary metadata. |
| 878 | owner (optional): The owner of the data source, typically the email of the primary |
| 879 | maintainer. |
| 880 | """ |
| 881 | super().__init__(name=name, description=description, tags=tags, owner=owner) |
| 882 | self.batch_source = batch_source |
| 883 | |
| 884 | def __eq__(self, other): |
| 885 | if not isinstance(other, PushSource): |
| 886 | return False |
| 887 | |
| 888 | if not super().__eq__(other): |
| 889 | return False |
| 890 | |
| 891 | if self.batch_source != other.batch_source: |
| 892 | return False |
| 893 | |
| 894 | return True |
| 895 | |
| 896 | def __hash__(self): |
| 897 | return super().__hash__() |
| 898 | |
| 899 | def validate(self, config: RepoConfig): |
| 900 | raise NotImplementedError |
| 901 | |
| 902 | def get_table_column_names_and_types( |
| 903 | self, config: RepoConfig |
| 904 | ) -> Iterable[Tuple[str, str]]: |
| 905 | raise NotImplementedError |
| 906 | |
| 907 | @staticmethod |
| 908 | def from_proto(data_source: DataSourceProto): |
no outgoing calls