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

Ignore DataPlane Services during generation #663

Merged
merged 1 commit into from
May 31, 2024
Merged
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
12 changes: 6 additions & 6 deletions .codegen/__init__.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ from databricks.sdk.credentials_provider import CredentialsStrategy
from databricks.sdk.mixins.files import DbfsExt
from databricks.sdk.mixins.compute import ClustersExt
from databricks.sdk.mixins.workspace import WorkspaceExt
{{- range .Services}}
from databricks.sdk.service.{{.Package.Name}} import {{.PascalName}}API{{end}}
{{- range .Services}} {{if not .IsDataPlane}}
from databricks.sdk.service.{{.Package.Name}} import {{.PascalName}}API{{end}}{{end}}
from databricks.sdk.service.provisioning import Workspace
from databricks.sdk import azure

Expand Down Expand Up @@ -61,7 +61,7 @@ class WorkspaceClient:
self._dbutils = _make_dbutils(self._config)
self._api_client = client.ApiClient(self._config)

{{- range .Services}}{{if and (not .IsAccounts) (not .HasParent)}}
{{- range .Services}}{{if and (not .IsAccounts) (not .HasParent) (not .IsDataPlane)}}
self._{{.SnakeName}} = {{template "api" .}}(self._api_client){{end -}}{{end}}

@property
Expand All @@ -76,7 +76,7 @@ class WorkspaceClient:
def dbutils(self) -> dbutils.RemoteDbUtils:
return self._dbutils

{{- range .Services}}{{if and (not .IsAccounts) (not .HasParent)}}
{{- range .Services}}{{if and (not .IsAccounts) (not .HasParent) (not .IsDataPlane)}}
@property
def {{.SnakeName}}(self) -> {{template "api" .}}:
{{if .Description}}"""{{.Summary}}"""{{end}}
Expand Down Expand Up @@ -117,7 +117,7 @@ class AccountClient:
self._config = config.copy()
self._api_client = client.ApiClient(self._config)

{{- range .Services}}{{if and .IsAccounts (not .HasParent)}}
{{- range .Services}}{{if and .IsAccounts (not .HasParent) (not .IsDataPlane)}}
self._{{(.TrimPrefix "account").SnakeName}} = {{template "api" .}}(self._api_client){{end -}}{{end}}

@property
Expand All @@ -128,7 +128,7 @@ class AccountClient:
def api_client(self) -> client.ApiClient:
return self._api_client

{{- range .Services}}{{if and .IsAccounts (not .HasParent)}}
{{- range .Services}}{{if and .IsAccounts (not .HasParent) (not .IsDataPlane)}}
@property
def {{(.TrimPrefix "account").SnakeName}}(self) -> {{template "api" .}}:{{if .Description}}
"""{{.Summary}}"""{{end}}
Expand Down
3 changes: 2 additions & 1 deletion .codegen/service.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}:{{if .Descriptio
{{- end -}}
{{- end -}}

{{range .Services}}
{{range .Services}} {{if not .IsDataPlane}}
class {{.PascalName}}API:{{if .Description}}
"""{{.Comment " " 110}}"""
{{end}}
Expand Down Expand Up @@ -195,6 +195,7 @@ class {{.PascalName}}API:{{if .Description}}
return self.{{template "safe-snake-name" .}}({{range $i, $x := .Request.Fields}}{{if $i}}, {{end}}{{template "safe-snake-name" .}}={{template "safe-snake-name" .}}{{end}}).result(timeout=timeout)
{{end}}
{{end -}}
{{end}}
{{- end}}

{{define "method-parameters" -}}
Expand Down
Loading