@@ -41,12 +41,11 @@ class AzureCosmosStorage(Storage):
4141
4242 def __init__ (
4343 self ,
44- base_dir : str | None = None ,
45- container_name : str | None = None ,
44+ base_dir : str ,
45+ container_name : str ,
4646 connection_string : str | None = None ,
4747 cosmosdb_account_url : str | None = None ,
4848 encoding : str = "utf-8" ,
49- ** kwargs : Any ,
5049 ) -> None :
5150 """Create a CosmosDB storage instance."""
5251 logger .info ("Creating cosmosdb storage" )
@@ -56,28 +55,23 @@ def __init__(
5655 logger .error (msg )
5756 raise ValueError (msg )
5857
59- if connection_string is None and cosmosdb_account_url is None :
60- msg = "CosmosDB Storage requires either a connection_string or cosmosdb_account_url to be specified."
61- logger .error (msg )
62- raise ValueError (msg )
63-
6458 if connection_string is not None and cosmosdb_account_url is not None :
6559 msg = "CosmosDB Storage requires either a connection_string or cosmosdb_account_url to be specified, not both."
6660 logger .error (msg )
6761 raise ValueError (msg )
6862
69- if container_name is None :
70- msg = "CosmosDB Storage requires a container_name to be specified."
71- logger .error (msg )
72- raise ValueError (msg )
73-
7463 if connection_string :
7564 self ._cosmos_client = CosmosClient .from_connection_string (connection_string )
7665 elif cosmosdb_account_url :
7766 self ._cosmos_client = CosmosClient (
7867 url = cosmosdb_account_url ,
7968 credential = DefaultAzureCredential (),
8069 )
70+ else :
71+ msg = "CosmosDB Storage requires either a connection_string or cosmosdb_account_url to be specified."
72+ logger .error (msg )
73+ raise ValueError (msg )
74+
8175 self ._encoding = encoding
8276 self ._database_name = database_name
8377 self ._connection_string = connection_string
0 commit comments