Skip to content

bug/unexpected kwarg in MongoDB Destination Connector #68

Open
@ron-unstructured

Description

@ron-unstructured

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(),
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions