utkarsharma2 commented on code in PR #35919:
URL: https://github.com/apache/airflow/pull/35919#discussion_r1415617479
##########
airflow/providers/weaviate/hooks/weaviate.py:
##########
@@ -119,38 +125,204 @@ def test_connection(self) -> tuple[bool, str]:
self.log.error("Error testing Weaviate connection: %s", e)
return False, str(e)
+ @retry(reraise=True, stop=stop_after_attempt(3),
retry=retry_if_exception_type(requests.ConnectionError))
def create_class(self, class_json: dict[str, Any]) -> None:
"""Create a new class."""
client = self.conn
client.schema.create_class(class_json)
- def create_schema(self, schema_json: dict[str, Any]) -> None:
+ @retry(reraise=True, stop=stop_after_attempt(3),
retry=retry_if_exception_type(requests.ConnectionError))
+ def create_schema(self, schema_json: dict[str, Any] | str) -> None:
"""
Create a new Schema.
Instead of adding classes one by one , you can upload a full schema in
JSON format at once.
- :param schema_json: The schema to create
+ :param schema_json: The schema to create or path to the json file
holding the schema
Review Comment:
Updated the description as per suggestion.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]