Commit Graph

200 Commits

Author SHA1 Message Date
Shane Harvey
da4df79555
PYTHON-3508 Improve the performance of GridOut.readline and GridOut.read (#1109) 2022-11-07 10:37:33 -08:00
Steven Silvester
a00aabfa0d
PYTHON-3502 GridFSBucket.download_to_stream slow (#1108) 2022-11-04 13:47:32 -05:00
Shane Harvey
935f926bd9
PYTHON-3362 Ignore wtimeout when timeoutMS or timeout() is configured (#1013)
Apply client timeoutMS to gridfs operations.
2022-07-19 17:46:09 -07:00
Steven Silvester
b40f13bf7d
PYTHON-3311 Module "pymongo" does not explicitly export attribute "MongoClient"; implicit reexport disabled (#994) 2022-07-06 18:30:00 -05:00
Ben Warner
4ae93c4937
PYTHON-1552 Prevent uploading partial or corrupt GridFS files after an error occurs 2022-06-16 15:26:27 -07:00
Shane Harvey
6e99bf4515 BUMP 4.1.0 2022-04-04 10:57:01 -07:00
Steven Silvester
b3604a81d3
PYTHON-3171 Add usage of NoReturn annotation (#901) 2022-03-16 15:26:10 -05:00
Steven Silvester
a0fe7c03af
PYTHON-3120 Set up flake8 linting (#868) 2022-02-17 06:44:08 -06:00
Steven Silvester
80314255d7
PYTHON-3092 Add Type Discovery Files (#863) 2022-02-11 12:41:29 -06:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter (#852) 2022-02-09 06:44:28 -06:00
Steven Silvester
dd6c140d43
PYTHON-3060 Add typings to pymongo package (#831) 2022-02-02 21:12:36 -06:00
Steven Silvester
52ed5a4135
PYTHON-3052 Add Typings to PyMongo Itself (#829) 2022-01-13 16:09:48 -06:00
Shane Harvey
e27131546c
PYTHON-2998 Remove md5 checksums from gridfs and remove disable_md5 (#776)
Speed up gridfs tests (shaves off about 2 minutes on macOS).
2021-11-04 17:25:11 -07:00
Shane Harvey
fb38fbe35e
PYTHON-2046 Change default JSONMode and dumps output from LEGACY to RELAXED (#711) 2021-09-08 11:33:41 -07:00
henrifroese
fa9531b4bf
PYTHON-2824 Make GridOut implement full io.IOBase spec (#677)
Make GridOut inherit from io.IOBase to be a fully "file-like" object (https://docs.python.org/3/glossary.html#term-file-like-object). Implement missing methods `readlines`, `writelines`,
`writable`, `fileno`, `flush`, `isatty`, `truncate`,
and property `closed`, following the spec
(https://docs.python.org/3/library/io.html#io.IOBase.writable).

Iterating over GridOut previously returned chunks, but IOBase specifies
that lines should be returned. Thus, the `GridOutIterator` returning chunks is removed
and GridOut simply uses the existing IOBase iterator implementation (returning `self`
in `__iter__` and using `readline` in `__next__`).

Additionally, iterating over GridOut previously did not move the "file pointer" along, i.e.
`next(iter(some_grid_out_object))` always gave the same result (the first chunk of the file)
as it would create a new iterator starting at the top of the file. This is now fixed as well, so
a first call to `next(iter(some_grid_out_object))` gives the first line, and subsequent calls return
the subsequent lines.
2021-08-23 11:45:34 -04:00
Shane Harvey
f9bfd11290
PYTHON-2870 Add support for man/text/latex/etc.. docs output (#708)
Regenerate sphinx makefile with sphinx-quickstart 3.5.4.
Remove problematic mongodoc sphinx extension.
2021-08-19 13:31:46 -07:00
Bernie Hackett
521f7b9af4 PYTHON-2133 Fix up docs
And finish deleting python 2 specific code.
2021-01-21 15:49:23 -08:00
Bernie Hackett
88bb1b4608 PYTHON-2133 Remove Py2 compatibility from gridfs 2021-01-19 21:08:27 -08:00
Shane Harvey
5d92b2f552
PYTHON-2243 Raise informative error message when attempting a GridFS operation in a transaction (#454) 2020-07-07 18:55:17 -07:00
Bernie Hackett
6ec594eef1 PYTHON-1738 GridFS length should be an int64 2019-07-15 13:05:16 -07:00
Prashant Mital
749116287a
PYTHON-1783 Decode user-facing documents but not internal driver-server
communications.
2019-04-16 15:01:42 -07:00
Terence D. Honles
481600b7fe PYTHON-1695 GridOut/GridIn more closely implement io.IOBase (#387)
Allows GridOut to be wrapped with zipfile.ZipFile from the stdlib.
2019-03-28 14:25:06 -07:00
Shane Harvey
956fd92e82 PYTHON-1721 Improve GridFS file download performance (#413)
This change uses a cursor to download all the chunks in a GridFS file
instead of using individual find_one operations to read each chunk.
Detect truncated/missing/extra chunks in _GridOutChunkIterator.
Only detect extra chunks after reading the final chunk, not on every
call to read().
Retry once after CursorNotFound for backward compatibility.
2019-03-13 15:44:40 -07:00
Bernie Hackett
1c7085d371 PYTHON-1458 - Make MD5 digest optional in GridFS 2018-03-30 18:59:19 -07:00
Bernie Hackett
ba7c95a9df PYTHON-1462 - Import ABCs from collections.abc 2018-02-12 19:42:44 -08:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
A. Jesse Jiryu Davis
c1ec855060 PYTHON-1332 - Send lsid with all commands 2017-09-29 14:52:26 -04:00
A. Jesse Jiryu Davis
e86742d27b PYTHON-1332 - Session param for GridFS methods
Also refactor session tests.
2017-09-12 16:27:54 -04:00
Xiao Tan
46532890c1 Fix bug: SON object and list can not be compared (#330) 2017-07-21 18:26:50 -07:00
A. Jesse Jiryu Davis
42c5df83fb GridFS docs fixes. 2016-10-30 20:59:58 -04:00
A. Jesse Jiryu Davis
cdb40fb747 GridFSBucket docs whitespace fixes. 2016-10-30 18:16:51 -04:00
Bernie Hackett
12bd4ac5ea PYTHON-1097 - Support GridFS custom file_id methods 2016-06-17 19:06:47 -07:00
aherlihy
a3cf3cf568 PYTHON-1031 - GridFsBucket.download_to_stream now uses GridOutIterator 2015-12-15 15:28:20 -05:00
Bernie Hackett
08a668f36d PYTHON-1019 - GridIn must use ReadPreference.PRIMARY 2015-12-07 11:23:06 -08:00
aherlihy
04b1b8ad34 open_upload_stream returns only GridIn 2015-08-11 12:14:06 -04:00
aherlihy
b9baa8ae8a PYTHON-960 - GridFS spec compliance 2015-08-06 12:41:40 -04:00
aherlihy
6b644054b7 PYTHON-860 - Ignore unauthorized errors for index creation in GridFs 2015-07-21 12:33:34 -04:00
Bernie Hackett
5fcc5c72ac PYTHON-951 - Raise CorruptGridFile for truncated chunks. 2015-06-16 16:43:15 -07:00
behackett
42fc925b11 PYTHON-900 - Fix GridFS.delete(). 2015-04-16 20:20:22 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
f93c73aa73 PYTHON-861 - create/ensure index changes
- Deprecate ensure_index
- Remove caching from create_index
- In create_index, remove support for the cache_for param, and the
  bucket_size and drop_dups aliases (they all remain in ensure_index)
- GridFS uses create_index
- Fix up tests.
2015-03-14 13:38:13 -07:00
Bernie Hackett
3f3b6bedfc PYTHON-846 - Database.connection -> Database.client 2015-02-25 11:57:39 -08:00
Bernie Hackett
7164ba2f41 PYTHON-839 - Better validation error messages. 2015-02-25 10:14:29 -08:00
Bernie Hackett
12d74ff56f PYTHON-821 - Use new CRUD API in GridFS. 2015-02-13 13:12:58 -08:00
behackett
c07e543e58 PYTHON-820 - API changes for find/find_one to comply with CRUD spec.
- Changed parameter names (default values and behaviors remain the same):
  - spec (spec_or_id in find_one) -> filter
  - fields -> projection
  - partial -> allow_partial_results

- The "timeout" option is renamed to "no_cursor_timeout" with its default
  changed to False.

- The tailable, await_data, and exhaust options will be replaced with a
  cursor_type option. Valid values:
  - cursor.NON_TAILABLE
  - cursor.TAILABLE
  - cursor.TAILABLE_AWAIT
  - cursor.EXHAUST

- The following options are added:
  - oplog_replay (bool - default False) - only valid with tailable cursors
    against the oplog.
  - modifiers (document - default None) - A dict of query modifiers. See
    http://docs.mongodb.org/manual/reference/operator/query-modifier/#modifiers for
    options.

- The following options are removed, replaced by the "modifiers" option:
  - max_scan
  - snapshot

- The as_class option is removed. Use Collection.with_options instead.
2015-01-19 22:10:56 -08:00
Bernie Hackett
73edd2c134 PYTHON-785 - Really check Collection's write_concern in GridFS. 2014-12-23 12:04:10 -08:00
Bernie Hackett
0c277f6fd2 PYTHON-785 - Check Collection's write_concern in GridFS 2014-12-20 22:34:47 -08:00
A. Jesse Jiryu Davis
b1183ada1f PYTHON-785 No need for getlasterror before filemd5.
Obsoleted by commit fab611f63.
2014-12-20 09:29:56 -05:00
Bernie Hackett
f6a260c683 PYTHON-805 - Add with_options and remove per helper read_preference
This change removes the read_preference parameter from various
command helpers on the Collection object. Those options were
never shipped in a PyMongo release. It also documents which
helpers obey Collection.read_preference.

The bigger change is the removal of the read_preference, tag_sets,
and secondary_acceptable_latency_ms params from find() and find_one()
- a major backward breaking change. Collection.with_options
is intended to replace their use.

coll.find(read_preference=ReadPreference.SECONDARY)

changes to

coll.with_options(read_preference=ReadPreference.SECONDARY).find()
2014-12-17 15:06:03 -08:00
A. Jesse Jiryu Davis
2ba730722b PYTHON-526 Remove 'compile_re' option.
PyMongo now never attempts to compile BSON regular expressions as Python native
regular expressions.
2014-12-05 14:06:38 -05:00