Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mongoengine to 0.29.1 #829

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pyup-bot
Copy link
Collaborator

This PR updates mongoengine from 0.16.3 to 0.29.1.

Changelog

0.29.0

=================
- Fix weakref in EmbeddedDocumentListField (causing brief mem leak in certain circumstances) 2827
- Fix pillow deprecation warning related with LANCZOS filter 2824
- Allow gt/gte/lt/lte/ne operators to be used with a list as value on ListField 2813
- Switch tox to use pytest instead of legacy `python setup.py test` 2804
- Add support for timeseries collection 2661
- Add support in tests for MongoDB 7.0, pymongo 4.7 and pymongo 4.8 in the CI 2826
- Add support for `array_filters` in Queryset.modify 2811
- Integrate a docker-compose setup for local testing 2555
- improve ReferenceField wrong usage detection
- Fix no_dereference thread-safetyness 2830
- BREAKING CHANGE: max_length in ListField is now keyword only on ListField signature
- BREAKING CHANGE: Force `field` argument of ListField/DictField to be a field instance (e.g ListField(StringField()) instead of ListField(StringField)

0.28.2

=================
- Fix typing import incompatible with Pymongo 3.7 2802

0.28.1

=================
- Fix bug related with recent updates to no_dereference context manager 2799

0.28.0

=================
- Fix for uuidRepresentation not read when provided in URI 2741
- Add option to user array_filters https://www.mongodb.com/docs/manual/reference/operator/update/positional-filtered/ #2769
- Fix combination of __raw__ and mongoengine syntax 2773
- Add tests against MongoDB 6.0 and MongoDB 7.0 in the pipeline
- Fix validate() not being called when inheritance is used in EmbeddedDocument and validate is overriden 2784
- Add support for readPreferenceTags in connection parameters 2644
- Use estimated_documents_count OR documents_count when count is called, based on the query 2529
- Fix no_dereference context manager which wasn't turning off auto-dereferencing correctly in some cases 2788
- BREAKING CHANGE: no_dereference context manager no longer returns the class in __enter__ 2788
 as it was useless and making it look like it was returning a different class although it was the same.
 Thus, it must be called like `with no_dereference(User):` and no longer `with no_dereference(User) as ...:`
- Added __raw__ to :meth:`~mongoengine.Queryset.order_by()` to allow to provide raw pymongo 'sort' argument and get around some of the limitations 2783
- Add `text_score` argument on :meth:`~mongoengine.Document.search_text()` to allow text_score computation to be turned off
 as it interfere with natural returned documents order 2759

0.27.0

=================
- Update uuidRepresentation warnings with "unspecified" as the future default (instead of 'standard' previously advertised) 2739
- Added `mongo_client_class` optional parameter to connect() to allow to use an alternative mongo client than pymongo.MongoClient.
Typically to support mock mongo libraries like mongomock, montydb, mongita 2729
- BREAKING CHANGE: connecting MongoEngine with mongomock should now use the new `mongo_client_class`
For more info, check https://docs.mongoengine.org/guide/mongomock.html
- Fix DictField that always gets marked as changed 2606
- fix for Queryset.none() that has no effect on update/aggregate / first 2669

0.26.0

=================
- BREAKING CHANGE: Improved the performance of :meth:`~mongoengine.Document.save()`
by removing the call to :meth:`~mongoengine.Document.ensure_indexes` unless
``meta['auto_create_index_on_save']`` is set to True. With the default settings, Document indexes
will still be created on the fly, during the first usage of the collection (query, insert, etc),
they will just not be re-created whenever .save() is called.
- Added meta ``auto_create_index_on_save`` so you can enable index creation
on :meth:`~mongoengine.Document.save()` (as it was < 0.26.0).
- BREAKING CHANGE: remove deprecated method ``ensure_index`` (replaced by ``create_index`` long time ago).
- Addition of Decimal128Field: :class:`~mongoengine.fields.Decimal128Field` for accurate representation of Decimals (much better than the legacy field DecimalField).
Although it could work to switch an existing DecimalField to Decimal128Field without applying a migration script,
it is not recommended to do so (DecimalField uses float/str to store the value, Decimal128Field uses Decimal128).
- BREAKING CHANGE: When using ListField(EnumField) or DictField(EnumField), the values weren't always cast into the Enum (2531)
- BREAKING CHANGE (bugfix) Querying ObjectIdField or ComplexDateTimeField with None no longer raise a ValidationError (2681)
- Allow updating a field that has an operator name e.g. "type" with .update(set__type="foo"). It was raising an error previously. 2595

0.25.0

=================
- Support MONGODB-AWS authentication mechanism (with `authmechanismproperties`) 2507
- Bug Fix - distinct query doesn't obey the ``no_dereference()``. 2663
- Add tests against Mongo 5.0 in pipeline
- Drop support for Python 3.6 (EOL)
- Bug fix support for PyMongo>=4 to fix "pymongo.errors.InvalidOperation: Cannot use MongoClient after close"
errors. 2627

0.24.2

=================
- Bug fix regarding uuidRepresentation that was case sensitive 2650

0.24.1

=================
- Allow pymongo<5.0 to be pulled
- Don't use deprecated property for emptiness check in queryset base 2633

0.24.0

=================
- EnumField improvements: now ``choices`` limits the values of an enum to allow
- Fix bug that prevented instance queryset from using custom queryset_class 2589
- Fix deepcopy of EmbeddedDocument 2202
- Introduce a base exception class for MongoEngine exceptions (MongoEngineException).
Note that this doesn't concern the pymongo errors 2515
- Fix error when using precision=0 with DecimalField 2535
- Add support for regex and whole word text search query 2568
- Add support for update aggregation pipeline 2578
- BREAKING CHANGE: Updates to support pymongo 4.0. Where possible deprecated
functionality has been migrated, but additional care should be taken when
migrating to pymongo 4.0 as existing code may have been using deprecated
features which have now been removed 2614.

For the pymongo migration guide see:
https://pymongo.readthedocs.io/en/stable/migrate-to-pymongo4.html.

In addition to the changes in the migration guide, the following is a high
level overview of the changes made to MongoEngine when using pymongo 4.0:

- limited support of geohaystack indexes has been removed
- ``QuerySet.map_reduce`` has been migrated from ``Collection.map_reduce``
 and ``Collection.inline_map_reduce`` to use
 ``db.command({mapReduce: ..., ...})`` and support between the two may need
 additional verification.
- UUIDs are encoded with the ``pythonLegacy`` encoding by default instead of
 the newer and cross platform ``standard`` encoding. Existing UUIDs will
 need to be migrated before changing the encoding, and this should be done
 explicitly by the user rather than switching to a new default by
 MongoEngine. This default will change at a later date, but to allow
 specifying and then migrating to the new format a default ``json_options``
 has been provided.
- ``Queryset.count`` has been using ``Collection.count_documents`` and
 transparently falling back to ``Collection.count`` when using features that
 are not supported by ``Collection.count_documents``. ``Collection.count``
 has been removed and no automatic fallback is possible. The migration guide
 documents the extended functionality which is no longer supported. Rewrite
 the unsupported queries or fetch the whole result set and perform the count
 locally.
- Pymongo 4 removed db.authenticate(), on which we were relying for authenticating
 with username/password. The migration involved switching to providing credentials to
 MongoClient BUT in case the authSource isn't provided, db.authenticate used to default to
 authSource=current-database and MongoClient defaults to authSource="admin". Long story short,
 if you observe authentication issue after migrating, make sure you provide the authSource
 explicitly. (see 2626)

0.23.1

=================
- Bug fix: ignore LazyReferenceFields when clearing _changed_fields 2484
- Improve connection doc 2481

0.23.0

=================
- Bugfix: manually setting SequenceField in DynamicDocument doesn't increment the counter 2471
- Add MongoDB 4.2 and 4.4 to CI
- Add support for allowDiskUse on querysets 2468

0.22.1

=================
- Declare that Py3.5 is not supported in package metadata 2449
- Moved CI from Travis to Github-Actions

0.22.0

=================
- Fix LazyReferenceField dereferencing in embedded documents 2426
- Fix regarding the recent use of Cursor.__spec in .count() that was interfering with mongomock 2425
- Drop support for Python 3.5 by introducing f-strings in the codebase

0.21.0

=================
- Bug fix in DynamicDocument which is not parsing known fields in constructor like Document do 2412
- When using pymongo >= 3.7, make use of Collection.count_documents instead of Collection.count
 and Cursor.count that got deprecated in pymongo >= 3.7.
 This should have a negative impact on performance of count see Issue 2219
- Fix a bug that made the queryset drop the read_preference after clone().
- Remove Py3.5 from CI as it reached EOL and add Python 3.9
- Fix some issues related with db_field/field conflict in constructor 2414
- BREAKING CHANGE: Fix the behavior of Doc.objects.limit(0) which should return all documents (similar to mongodb) 2311
- Bug fix in ListField when updating the first item, it was saving the whole list, instead of
 just replacing the first item (as usually done when updating 1 item of the list) 2392
- Add EnumField: ``mongoengine.fields.EnumField``
- Refactoring - Remove useless code related to Document.__only_fields and Queryset.only_fields
- Fix query transformation regarding special operators 2365
- Bug Fix: Document.save() fails when shard_key is not _id 2154

0.20.0

=================
- ATTENTION: Drop support for Python2
- Add Mongo 4.0 to Travis
- Fix error when setting a string as a ComplexDateTimeField 2253
- Bump development Status classifier to Production/Stable 2232
- Improve Queryset.get to avoid confusing MultipleObjectsReturned message in case multiple match are found 630
- Fixed a bug causing inaccurate query results, while combining ``__raw__`` and regular filters for the same field 2264
- Add support for the `elemMatch` projection operator in .fields() (e.g BlogPost.objects.fields(elemMatch__comments="test")) 2267
- DictField validate failed without default connection (bug introduced in 0.19.0) 2239
- Remove methods that were deprecated years ago:
 - name parameter in Field constructor e.g `StringField(name="...")`, was replaced by db_field
 - Queryset.slave_okay() was deprecated since pymongo3
 - dropDups was dropped with MongoDB3
 - ``Queryset._ensure_indexes`` and ``Queryset.ensure_indexes``, the right method to use is ``Document.ensure_indexes``
- Added pre-commit for development/CI 2212
- Renamed requirements-lint.txt to requirements-dev.txt 2212
- Support for setting ReadConcern 2255

0.19.1

=================
- Tests require Pillow < 7.0.0 as it dropped Python2 support
- DEPRECATION: The interface of ``QuerySet.aggregate`` method was changed, it no longer takes an unpacked list of
 pipeline steps (*pipeline) but simply takes the pipeline list just like ``pymongo.Collection.aggregate`` does. 2079

0.19.0

=================
- BREAKING CHANGE: ``class_check`` and ``read_preference`` keyword arguments are no longer available when filtering a ``QuerySet``. 2112
 - Instead of ``Doc.objects(foo=bar, read_preference=...)`` use ``Doc.objects(foo=bar).read_preference(...)``.
 - Instead of ``Doc.objects(foo=bar, class_check=False)`` use ``Doc.objects(foo=bar).clear_cls_query(...)``.
 - This change also renames the private ``QuerySet._initial_query`` attribute to ``_cls_query``.
- BREAKING CHANGE: Removed the deprecated ``format`` param from ``QuerySet.explain``. 2113
- BREAKING CHANGE: Renamed ``MongoEngineConnectionError`` to ``ConnectionFailure``. 2111
 - If you catch/use ``MongoEngineConnectionError`` in your code, you'll have to rename it.
- BREAKING CHANGE: Positional arguments when instantiating a document are no longer supported. 2103
 - From now on keyword arguments (e.g. ``Doc(field_name=value)``) are required.
- BREAKING CHANGE: A ``LazyReferenceField`` is now stored in the ``_data`` field of its parent as a ``DBRef``, ``Document``, or ``EmbeddedDocument`` (``ObjectId`` is no longer allowed). 2182
- DEPRECATION: ``Q.empty`` & ``QNode.empty`` are marked as deprecated and will be removed in a next version of MongoEngine. 2210
 - Added ability to check if Q or QNode are empty by parsing them to bool.
 - Instead of ``Q(name="John").empty`` use ``not Q(name="John")``.
- Fix updating/modifying/deleting/reloading a document that's sharded by a field with ``db_field`` specified. 2125
- Only set no_cursor_timeout when requested (fixes an incompatibility with MongoDB 4.2) 2148
- ``ListField`` now accepts an optional ``max_length`` parameter. 2110
- Improve error message related to InvalidDocumentError 2180
- Added BulkWriteError to replace NotUniqueError which was misleading in bulk write insert 2152
- Added ability to compare Q and Q operations 2204
- Added ability to use a db alias on query_counter 2194
- Added ability to specify collations for querysets with ``Doc.objects.collation`` 2024
- Fix updates of a list field by negative index 2094
- Switch from nosetest to pytest as test runner 2114
- The codebase is now formatted using ``black``. 2109
- Documentation improvements:
 - Documented how `pymongo.monitoring` can be used to log all queries issued by MongoEngine to the driver.

0.18.2

=================
- Replace deprecated PyMongo v2.x methods with their v3.x equivalents in the ``SequenceField``. 2097
- Various code clarity and documentation improvements.

0.18.1

=================
- Fix a bug introduced in 0.18.0 which was causing ``Document.save`` to update all the fields instead of updating only the modified fields. This bug only occurred when using a custom PK. 2082
- Add Python 3.7 to Travis CI. 2058

0.18.0

=================
- Drop support for EOL'd MongoDB v2.6, v3.0, and v3.2.
- MongoEngine now requires PyMongo >= v3.4. Travis CI now tests against MongoDB v3.4 – v3.6 and PyMongo v3.4 – v3.6. 2017 2066
- Improve performance by avoiding a call to ``to_mongo`` in ``Document.save``. 2049
- Connection/disconnection improvements:
 - Expose ``mongoengine.connection.disconnect`` and ``mongoengine.connection.disconnect_all``.
 - Fix disconnecting. 566 1599 605 607 1213 565
 - Improve documentation of ``connect``/``disconnect``.
 - Fix issue when using multiple connections to the same mongo with different credentials. 2047
 - ``connect`` fails immediately when db name contains invalid characters. 2031 1718
- Fix the default write concern of ``Document.save`` that was overwriting the connection write concern. 568
- Fix querying on ``List(EmbeddedDocument)`` subclasses fields. 1961 1492
- Fix querying on ``(Generic)EmbeddedDocument`` subclasses fields. 475
- Fix ``QuerySet.aggregate`` so that it takes limit and skip value into account. 2029
- Generate unique indices for ``SortedListField`` and ``EmbeddedDocumentListFields``. 2020
- BREAKING CHANGE: Changed the behavior of a custom field validator (i.e ``validation`` parameter of a ``Field``). It is now expected to raise a ``ValidationError`` instead of returning ``True``/``False``. 2050
- BREAKING CHANGES (associated with connection/disconnection fixes):
 - Calling ``connect`` 2 times with the same alias and different parameter will raise an error (should call ``disconnect`` first).
 - ``disconnect`` now clears ``mongoengine.connection._connection_settings``.
 - ``disconnect`` now clears the cached attribute ``Document._collection``.
- BREAKING CHANGE: ``EmbeddedDocument.save`` & ``.reload`` no longer exist. 1552

0.17.0

=================
- POTENTIAL BREAKING CHANGE: All result fields are now passed, including internal fields (``_cls``, ``_id``) when using ``QuerySet.as_pymongo``. 1976
- Document a BREAKING CHANGE introduced in 0.15.3 and not reported at that time. 1995
- DEPRECATION: ``EmbeddedDocument.save`` & ``.reload`` are marked as deprecated and will be removed in a next version of MongoEngine. 1552
- Fix ``QuerySet.only`` working improperly after using ``QuerySet.count`` of the same instance of a ``QuerySet``.
- Fix ``batch_size`` that was not copied when cloning a ``QuerySet`` object. 2011
- Fix ``InvalidStringData`` error when using ``modify`` on a ``BinaryField``. 1127
- Fix test suite and CI to support MongoDB v3.4. 1445
- Fix reference fields querying the database on each access if value contains orphan DBRefs.
Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant