-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-3146 Test Failure - Could not import extension sphinxcontrib.shellcheck #889
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming the tests pass
I scheduled the doctests variant |
The docs build now, but we are failing two of the actual doctests |
Let's fix the two failing tests. The CodecOptions repr test starting failing after the typing change here: https://evergreen.mongodb.com/task/mongo_python_driver_tests_doctests__platform~ubuntu_18.04_python_version~3.6_doctests_52ed5a4135a76480e03e96eb0369c2c4eae0c3f7_22_01_13_22_09_48:
6.0-latest has added new fields to duplicate key errors, we'll need to add them or ignore them:
|
Updated and rescheduled |
doc/faq.rst
Outdated
unicode_decode_error_handler='strict', | ||
tzinfo=None, type_registry=TypeRegistry(type_codecs=[], | ||
fallback_encoder=None)) | ||
CodecOptions(document_class=bson.son.SON, tz_aware=False, uuid_representation=UuidRepresentation.UNSPECIFIED, unicode_decode_error_handler='strict', tzinfo=None, type_registry=TypeRegistry(type_codecs=[], fallback_encoder=None)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a bug or does it have something to do with inheriting from SON now inheriting typing.Dict
? On Python 3.6:
>>> repr(SON)
'bson.son.SON'
Vs Python 3.7+
>>> repr(SON)
"<class 'bson.son.SON'>"
Should we bother trying to make this consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Python 3.7+, the built in container types are generic as well. I don't think it is worth supporting the Python 3.6 syntax in the doctests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see:
>>> repr(SON)
"<class 'bson.son.SON'>"
>>> repr(SON[str, int])
'bson.son.SON[str, int]'
>>> repr(MongoClient)
"<class 'pymongo.mongo_client.MongoClient'>"
>>> repr(MongoClient[dict])
'pymongo.mongo_client.MongoClient[dict]'
Seems odd that they didn't stick with one representation. There's probably a related CPython or Mypy bugs report but I can't find it at the moment.
doc/examples/bulk.rst
Outdated
'index': 0,... | ||
'op': {'_id': 1}}, | ||
{'code': 11000, | ||
'errmsg': '...E11000...duplicate key error...', | ||
'errmsg': '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server is returning an empty errmsg seems unexpected and likely a bug in v6.0-latest. Could you file a server ticket for this?
Perhaps for now we can just do '...'
for the second errmsg field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc/examples/bulk.rst
Outdated
@@ -141,11 +141,12 @@ and fourth operations succeed. | |||
'upserted': [], | |||
'writeConcernErrors': [], | |||
'writeErrors': [{'code': 11000, | |||
'errmsg': '...E11000...duplicate key error...', | |||
'errmsg': 'E11000 duplicate key error collection: ' | |||
'bulk_example.test index: _id_ dup key: { _id: 1 }', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the previous version with ...
is more robust to changes in the server's errmsg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -36,7 +36,7 @@ insert a couple of example locations: | |||
>>> result = db.places.insert_many([{"loc": [2, 5]}, | |||
... {"loc": [30, 5]}, | |||
... {"loc": [1, 2]}, | |||
... {"loc": [4, 4]}]) # doctest: +ELLIPSIS | |||
... {"loc": [4, 4]}]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This # doctest: +ELLIPSIS
feature is cool. So it's just another approach to wildcard characters basically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.