Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Client type in Usage Examples for "Account Groups" #627

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ __pycache__
databricks-sdk-py.iml
.databricks
.coverage
htmlcov
htmlcov
.python-version
70 changes: 35 additions & 35 deletions docs/account/iam/groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@

import time

from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
group = w.groups.create(display_name=f'sdk-{time.time_ns()}')
from databricks.sdk import AccountClient

a = AccountClient()

group = a.groups.create(display_name=f'sdk-{time.time_ns()}')

# cleanup
w.groups.delete(id=group.id)
a.groups.delete(id=group.id)

Create a new group.

Creates a group in the Databricks account with a unique name, using the supplied group details.

:param display_name: str (optional)
String that represents a human-readable group name
:param entitlements: List[:class:`ComplexValue`] (optional)
Entitlements assigned to the group. See [assigning entitlements] for a full list of supported
values.

[assigning entitlements]: https://docs.databricks.com/administration-guide/users-groups/index.html#assigning-entitlements
:param external_id: str (optional)
:param groups: List[:class:`ComplexValue`] (optional)
Expand All @@ -51,9 +51,9 @@
Corresponds to AWS instance profile/arn role.
:param schemas: List[:class:`GroupSchema`] (optional)
The schema of the group.

:returns: :class:`Group`


.. py:method:: delete(id: str)

Expand All @@ -63,24 +63,24 @@
.. code-block::

import time
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
group = w.groups.create(display_name=f'sdk-{time.time_ns()}')
w.groups.delete(id=group.id)

from databricks.sdk import AccountClient

a = AccountClient()

group = a.groups.create(display_name=f'sdk-{time.time_ns()}')

a.groups.delete(id=group.id)

Delete a group.

Deletes a group from the Databricks account.

:param id: str
Unique ID for a group in the Databricks account.




.. py:method:: get(id: str) -> Group

Expand All @@ -90,17 +90,17 @@
.. code-block::

import time
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
group = w.groups.create(display_name=f'sdk-{time.time_ns()}')
fetch = w.groups.get(id=group.id)

from databricks.sdk import AccountClient

a = AccountClient()

group = a.groups.create(display_name=f'sdk-{time.time_ns()}')

fetch = a.groups.get(id=group.id)

# cleanup
w.groups.delete(id=group.id)
a.groups.delete(id=group.id)

Get group details.

Expand Down
Loading