Skip to content

Commit

Permalink
Fix type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
judahrand committed Feb 26, 2024
1 parent 5255760 commit 631ba8a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 54 deletions.
22 changes: 12 additions & 10 deletions .codegen/__init__.py.tmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

import databricks.sdk.core as client
import databricks.sdk.dbutils as dbutils
from databricks.sdk.credentials_provider import CredentialsProvider
Expand Down Expand Up @@ -41,13 +43,13 @@ class WorkspaceClient:
"""
The WorkspaceClient is a client for the workspace-level Databricks REST API.
"""
def __init__(self, *{{range $args}}, {{.}}: str = None{{end}},
debug_truncate_bytes: int = None,
debug_headers: bool = None,
def __init__(self, *{{range $args}}, Optional[{{.}}]: str = None{{end}},
debug_truncate_bytes: Optional[int] = None,
debug_headers: Optional[bool] = None,
product="unknown",
product_version="0.0.0",
credentials_provider: CredentialsProvider = None,
config: client.Config = None):
credentials_provider: Optional[CredentialsProvider] = None,
config: Optional[client.Config] = None):
if not config:
config = client.Config({{range $args}}{{.}}={{.}}, {{end}}
credentials_provider=credentials_provider,
Expand Down Expand Up @@ -96,13 +98,13 @@ class AccountClient:
The AccountClient is a client for the account-level Databricks REST API.
"""

def __init__(self, *{{range $args}}, {{.}}: str = None{{end}},
debug_truncate_bytes: int = None,
debug_headers: bool = None,
def __init__(self, *{{range $args}}, Optional[{{.}}]: str = None{{end}},
debug_truncate_bytes: Optional[int = None,
debug_headers: Optional[bool = None,
product="unknown",
product_version="0.0.0",
credentials_provider: CredentialsProvider = None,
config: client.Config = None):
credentials_provider:Optional[CredentialsProvider] = None,
config: Optional[client.Config] = None):
if not config:
config = client.Config({{range $args}}{{.}}={{.}}, {{end}}
credentials_provider=credentials_provider,
Expand Down
90 changes: 46 additions & 44 deletions databricks/sdk/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 631ba8a

Please sign in to comment.