Skip to content

Commit

Permalink
docs(providers/microsoft): add comment for the type ignoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Aug 25, 2023
1 parent 95c21ae commit fe2567a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions airflow/providers/microsoft/azure/hooks/cosmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit fe2567a

Please sign in to comment.