Skip to content

Commit

Permalink
[Internal] Add cleanrooms package (#806)
Browse files Browse the repository at this point in the history
## Changes
The cleanrooms package is being introduced into the SDK. This ensures
that docs will be generated for this package when ready.

## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [ ] `make test` run locally
- [ ] `make fmt` applied
- [ ] relevant integration tests applied
  • Loading branch information
mgyucht authored Oct 30, 2024
1 parent 3db3569 commit f2b858c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/gen-client-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ class Generator:
Package("dashboards", "Dashboards", "Manage Lakeview dashboards"),
Package("marketplace", "Marketplace", "Manage AI and analytics assets such as ML models, notebooks, applications in an open marketplace"),
Package("apps", "Apps", "Build custom applications on Databricks"),
Package("cleanrooms", "Clean Rooms", "Manage clean rooms and their assets and task runs"),
]

def __init__(self):
Expand Down Expand Up @@ -375,13 +376,19 @@ def _make_folder_if_not_exists(folder):

def write_dataclass_docs(self):
self._make_folder_if_not_exists(f'{__dir__}/dbdataclasses')
all_packages = []
for pkg in self.packages:
module = importlib.import_module(f'databricks.sdk.service.{pkg.name}')
try:
module = importlib.import_module(f'databricks.sdk.service.{pkg.name}')
except ModuleNotFoundError:
print(f'No module found for {pkg.name}, continuing')
continue
all_packages.append(pkg.name)
all_members = [name for name, _ in inspect.getmembers(module, predicate=self._should_document)]
doc = DataclassesDoc(package=pkg, dataclasses=sorted(all_members))
with open(f'{__dir__}/dbdataclasses/{pkg.name}.rst', 'w') as f:
f.write(doc.as_rst())
all = "\n ".join(sorted([p.name for p in self.packages]))
all = "\n ".join(sorted(all_packages))
with open(f'{__dir__}/dbdataclasses/index.rst', 'w') as f:
f.write(f'''
Dataclasses
Expand Down

0 comments on commit f2b858c

Please sign in to comment.