Read from MongoDB - dispatched via @ray.remote to cluster workers.
(self, uri: str, database: str, collection: str, **kwargs)
| 514 | return RemoteDatasetProxy(remote_fn.remote(path, kwargs)) |
| 515 | |
| 516 | def read_mongo(self, uri: str, database: str, collection: str, **kwargs) -> Any: |
| 517 | """Read from MongoDB - dispatched via @ray.remote to cluster workers.""" |
| 518 | from feast.infra.ray_shared_utils import RemoteDatasetProxy |
| 519 | |
| 520 | @ray.remote |
| 521 | def _remote(mongo_uri, db, col, read_kwargs): |
| 522 | import ray |
| 523 | |
| 524 | return ray.data.read_mongo( |
| 525 | uri=mongo_uri, database=db, collection=col, **read_kwargs |
| 526 | ) |
| 527 | |
| 528 | opts = self._get_task_options() |
| 529 | remote_fn = _remote.options(**opts) if opts else _remote |
| 530 | return RemoteDatasetProxy(remote_fn.remote(uri, database, collection, kwargs)) |
| 531 | |
| 532 | def read_sql(self, sql: str, connection_url: str, **kwargs) -> Any: |
| 533 | """Read from SQL database - dispatched via @ray.remote to cluster workers. |
nothing calls this directly
no test coverage detected