unstructured
unstructured copied to clipboard
bug/unexpected kwarg in MongoDB Destination Connector
Describe the bug Got this error message following the MongoDB Destination Connector docs
TypeError: SimpleMongoDBConfig.init() got an unexpected keyword argument 'uri'
To Reproduce From the docs:
def get_writer() -> Writer:
return MongodbWriter(
connector_config=SimpleMongoDBConfig(
uri=os.getenv("MONGODB_URI"),
database=os.getenv("MONGODB_DATABASE_NAME"),
collection=os.getenv("DESTINATION_MONGO_COLLECTION"),
),
write_config=WriteConfig(),
)
The correct function should be:
def get_writer() -> Writer:
return MongodbWriter(
connector_config=SimpleMongoDBConfig(
MongoDBAccessConfig(uri=uri),
database=database,
collection=collection,
),
write_config=WriteConfig(),
)