nailo2c commented on code in PR #50518: URL: https://github.com/apache/airflow/pull/50518#discussion_r2096139374
########## providers/mongo/src/airflow/providers/mongo/hooks/mongo.py: ########## @@ -225,6 +225,39 @@ def get_collection(self, mongo_collection: str, mongo_db: str | None = None) -> return mongo_conn.get_database(mongo_db).get_collection(mongo_collection) + def create_collection( + self, + mongo_collection: str, + mongo_db: str | None = None, + create_if_exists: bool = True, + **create_kwargs: dict[str, Any], Review Comment: Hi @Lee-W, I found that if I change the type to `dict[str, Any]`, an error occurs when I run pre-commit locally. So let me roll it back to type `Any` error ``` providers/mongo/src/airflow/providers/mongo/hooks/mongo.py:253: error: Argument 2 to "create_collection" of "Database" has incompatible type "**dict[str, dict[str, Any]]"; expected "Optional[CodecOptions[Never]]" [arg-type] db.create_collection(mongo_collection, **create_kwargs) ^~~~~~~~~~~~~ ``` the command I used ``` pre-commit run --files providers/mongo/src/airflow/providers/mongo/hooks/mongo.py ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org