Skip to content

Commit

Permalink
Finishing main merging
Browse files Browse the repository at this point in the history
  • Loading branch information
99Lys committed Jan 6, 2025
1 parent 14ef710 commit 79bb2f9
Showing 1 changed file with 73 additions and 1 deletion.
74 changes: 73 additions & 1 deletion dbt/adapters/dremio/api/rest/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,76 @@ def delete_catalog(self, cid):
url,
self._parameters.authentication.get_headers(),
ssl_verify=self._parameters.authentication.verify_ssl,
)
)

# dbt docs integration within Dremio wikis and tags
def create_wiki(self, object_id: str, text: str):
url = UrlBuilder.wikis_management_url(self._parameters, object_id)
return _post(
url,
self._parameters.authentication.get_headers(),
json={"text": text},
ssl_verify=self._parameters.authentication.verify_ssl,
)

def retrieve_wiki(self, object_id: str):
url = UrlBuilder.wikis_management_url(self._parameters, object_id)
return _get(
url,
self._parameters.authentication.get_headers(),
ssl_verify=self._parameters.authentication.verify_ssl,
)

def update_wiki(self, object_id: str, text: str, version: int):
url = UrlBuilder.wikis_management_url(self._parameters, object_id)
return _post(
url,
self._parameters.authentication.get_headers(),
json={"text": text, "version": version},
ssl_verify=self._parameters.authentication.verify_ssl,
)

def delete_wiki(self, object_id: str, version: int):
url = UrlBuilder.wikis_management_url(self._parameters, object_id)
return _post(
url,
self._parameters.authentication.get_headers(),
json={"text": "", "version": version},
ssl_verify=self._parameters.authentication.verify_ssl,
)


def create_tags(self, dataset_id: str, tags: list[str]):
url = UrlBuilder.tags_management_url(self._parameters, dataset_id)
return _post(
url,
self._parameters.authentication.get_headers(),
json={"tags": tags},
ssl_verify=self._parameters.authentication.verify_ssl,
)

def retrieve_tags(self, dataset_id: str):
url = UrlBuilder.tags_management_url(self._parameters, dataset_id)
return _get(
url,
self._parameters.authentication.get_headers(),
ssl_verify=self._parameters.authentication.verify_ssl,
)

def update_tags(self, dataset_id: str, tags: list[str], version: str):
url = UrlBuilder.wikis_management_url(self._parameters, dataset_id)
return _post(
url,
self._parameters.authentication.get_headers(),
json={"tags": tags, "version": version},
ssl_verify=self._parameters.authentication.verify_ssl,
)

def delete_tags(self, dataset_id: str, version: str):
url = UrlBuilder.wikis_management_url(self._parameters, dataset_id)
return _post(
url,
self._parameters.authentication.get_headers(),
json={"tags": [], "version": version},
ssl_verify=self._parameters.authentication.verify_ssl,
)

0 comments on commit 79bb2f9

Please sign in to comment.