MCPcopy Create free account
hub / github.com/feast-dev/feast / read_mongo

Method read_mongo

sdk/python/feast/infra/ray_initializer.py:516–530  ·  view source on GitHub ↗

Read from MongoDB - dispatched via @ray.remote to cluster workers.

(self, uri: str, database: str, collection: str, **kwargs)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

_get_task_optionsMethod · 0.95
RemoteDatasetProxyClass · 0.90

Tested by

no test coverage detected