We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I need to use CodecOptions(tz_aware=True)
CodecOptions(tz_aware=True)
In motor I do this:
from bson.codec_options import CodecOptions import motor.motor_asyncio db = motor.motor_asyncio.AsyncIOMotorClient("connection_str")).get_database( "db_name", codec_options=CodecOptions(tz_aware=True), )
In mongomock_motor I tried:
mongomock_motor
from bson.codec_options import CodecOptions from mongomock_motor import AsyncMongoMockClient fake_db = AsyncMongoMockClient().get_database( "db_name", codec_options=CodecOptions(tz_aware=True), )
But got an error:
lib/python3.11/site-packages/mongomock_motor/__init__.py:242: in get_database self.__client.get_database(*args, **kwargs), lib/python3.11/site-packages/mongomock/mongo_client.py:158: in get_database db = self._database_accesses[name] = Database( lib/python3.11/site-packages/mongomock/database.py:45: in __init__ mongomock_codec_options.is_supported(codec_options) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ custom_codec_options = CodecOptions(document_class=dict, tz_aware=True, uuid_representation=UuidRepresentation.UNSPECIFIED, unicode_decode_er...ne, type_registry=TypeRegistry(type_codecs=[], fallback_encoder=None), datetime_conversion=DatetimeConversion.DATETIME) def is_supported(custom_codec_options): if not custom_codec_options: return None > return CodecOptions(**custom_codec_options._asdict()) E TypeError: CodecOptions.__new__() got an unexpected keyword argument 'datetime_conversion' lib/python3.11/site-packages/mongomock/codec_options.py:87: TypeError
Versions:
mongomock-motor==0.0.21 mongomock==4.1.2 pymongo==4.4.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I need to use
CodecOptions(tz_aware=True)
In motor I do this:
In
mongomock_motor
I tried:But got an error:
Versions:
The text was updated successfully, but these errors were encountered: