diff --git a/airflow/providers/microsoft/azure/hooks/cosmos.py b/airflow/providers/microsoft/azure/hooks/cosmos.py index 91f66bf351e07..4b42217e68ff9 100644 --- a/airflow/providers/microsoft/azure/hooks/cosmos.py +++ b/airflow/providers/microsoft/azure/hooks/cosmos.py @@ -144,6 +144,8 @@ def does_collection_exist(self, collection_name: str, database_name: str) -> boo if collection_name is None: raise AirflowBadRequest("Collection name cannot be None.") + # The ignores below is due to typing bug in azure-cosmos 9.2.0 + # https://github.com/Azure/azure-sdk-for-python/issues/31811 existing_container = list( self.get_conn() .get_database_client(self.__get_database_name(database_name)) @@ -169,6 +171,8 @@ def create_collection( # We need to check to see if this container already exists so we don't try # to create it twice + # The ignores below is due to typing bug in azure-cosmos 9.2.0 + # https://github.com/Azure/azure-sdk-for-python/issues/31811 existing_container = list( self.get_conn() .get_database_client(self.__get_database_name(database_name)) @@ -189,6 +193,8 @@ def does_database_exist(self, database_name: str) -> bool: if database_name is None: raise AirflowBadRequest("Database name cannot be None.") + # The ignores below is due to typing bug in azure-cosmos 9.2.0 + # https://github.com/Azure/azure-sdk-for-python/issues/31811 existing_database = list( self.get_conn().query_databases( "SELECT * FROM r WHERE r.id=@id", @@ -207,6 +213,8 @@ def create_database(self, database_name: str) -> None: # We need to check to see if this database already exists so we don't try # to create it twice + # The ignores below is due to typing bug in azure-cosmos 9.2.0 + # https://github.com/Azure/azure-sdk-for-python/issues/31811 existing_database = list( self.get_conn().query_databases( "SELECT * FROM r WHERE r.id=@id",