MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / open

Method open

gridfs/synchronous/grid_file.py:1570–1577  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1568 return lines
1569
1570 def open(self) -> None:
1571 if not self._file:
1572 _disallow_transactions(self._session)
1573 self._file = self._files.find_one({"_id": self._file_id}, session=self._session)
1574 if not self._file:
1575 raise NoFile(
1576 f"no file in gridfs collection {self._files!r} with _id {self._file_id!r}"
1577 )
1578
1579 def __getattr__(self, name: str) -> Any:
1580 if _IS_SYNC:

Callers 14

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