(
table: Union[pyarrow.Table, pyarrow.RecordBatch],
feature_view: Union["FeatureView", "BaseFeatureView", "OnDemandFeatureView"],
join_keys: Dict[str, ValueType],
)
| 408 | |
| 409 | |
| 410 | def _convert_arrow_to_proto( |
| 411 | table: Union[pyarrow.Table, pyarrow.RecordBatch], |
| 412 | feature_view: Union["FeatureView", "BaseFeatureView", "OnDemandFeatureView"], |
| 413 | join_keys: Dict[str, ValueType], |
| 414 | ) -> List[Tuple[EntityKeyProto, Dict[str, ValueProto], datetime, Optional[datetime]]]: |
| 415 | # This is a workaround for isinstance(feature_view, OnDemandFeatureView), which triggers a circular import |
| 416 | # Check for source_request_sources or source_feature_view_projections attributes to identify ODFVs |
| 417 | if ( |
| 418 | getattr(feature_view, "source_request_sources", None) is not None |
| 419 | or getattr(feature_view, "source_feature_view_projections", None) is not None |
| 420 | ): |
| 421 | return _convert_arrow_odfv_to_proto(table, feature_view, join_keys) # type: ignore[arg-type] |
| 422 | else: |
| 423 | return _convert_arrow_fv_to_proto(table, feature_view, join_keys) # type: ignore[arg-type] |
| 424 | |
| 425 | |
| 426 | def _convert_arrow_fv_to_proto( |
no test coverage detected