MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / open

Method open

gridfs/asynchronous/grid_file.py:1582–1589  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1580 return lines
1581
1582 async def open(self) -> None:
1583 if not self._file:
1584 _disallow_transactions(self._session)
1585 self._file = await self._files.find_one({"_id": self._file_id}, session=self._session)
1586 if not self._file:
1587 raise NoFile(
1588 f"no file in gridfs collection {self._files!r} with _id {self._file_id!r}"
1589 )
1590
1591 def __getattr__(self, name: str) -> Any:
1592 if _IS_SYNC:

Callers 13

getMethod · 0.95
open_download_streamMethod · 0.95
readlinesMethod · 0.95
__getattr__Method · 0.95
readchunkMethod · 0.95
_read_size_or_lineMethod · 0.95
test_closedMethod · 0.95
test_set_after_closeMethod · 0.95

Calls 3

NoFileClass · 0.90
_disallow_transactionsFunction · 0.70
find_oneMethod · 0.45

Tested by 7

test_closedMethod · 0.76
test_set_after_closeMethod · 0.76