Skip to content
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
8 changes: 4 additions & 4 deletions databricks/sdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pathlib
import re
import urllib.parse
from typing import Dict, Iterable, List, Optional
from typing import Any, Dict, Iterable, List, Optional

import requests

Expand Down Expand Up @@ -49,7 +49,7 @@ def __get__(self, cfg: "Config", owner):
return None
return cfg._inner.get(self.name, None)

def __set__(self, cfg: "Config", value: any):
def __set__(self, cfg: "Config", value: Any):
cfg._inner[self.name] = self.transform(value)

def __repr__(self) -> str:
Expand Down Expand Up @@ -580,7 +580,7 @@ def debug_string(self) -> str:
buf.append(f"Env: {', '.join(envs_used)}")
return ". ".join(buf)

def to_dict(self) -> Dict[str, any]:
def to_dict(self) -> Dict[str, Any]:
return self._inner

@property
Expand Down Expand Up @@ -713,7 +713,7 @@ def load_azure_tenant_id(self):
self.azure_tenant_id = path_segments[1]
logger.debug(f"Loaded tenant ID: {self.azure_tenant_id}")

def _set_inner_config(self, keyword_args: Dict[str, any]):
def _set_inner_config(self, keyword_args: Dict[str, Any]):
for attr in self.attributes():
if attr.name not in keyword_args:
continue
Expand Down
6 changes: 3 additions & 3 deletions databricks/sdk/dbutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ def get(
self,
taskKey: str,
key: str,
default: any = None,
debugValue: any = None,
default: Any = None,
debugValue: Any = None,
) -> None:
"""
Returns `debugValue` if present, throws an error otherwise as this implementation is always run outside of a job run
Expand All @@ -200,7 +200,7 @@ def get(
)
return debugValue

def set(self, key: str, value: any) -> None:
def set(self, key: str, value: Any) -> None:
"""
Sets a task value on the current task run
"""
Expand Down
4 changes: 2 additions & 2 deletions databricks/sdk/logger/round_trip_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def generate(self) -> str:
return "\n".join(sb)

@staticmethod
def _mask(m: Dict[str, any]):
def _mask(m: Dict[str, Any]):
for k in m:
if k in {
"bytes_value",
Expand All @@ -67,7 +67,7 @@ def _mask(m: Dict[str, any]):
m[k] = "**REDACTED**"

@staticmethod
def _map_keys(m: Dict[str, any]) -> List[str]:
def _map_keys(m: Dict[str, Any]) -> List[str]:
keys = list(m.keys())
keys.sort()
return keys
Expand Down
2 changes: 1 addition & 1 deletion databricks/sdk/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ def from_host(
from .credentials_provider import credentials_strategy

@credentials_strategy("noop", [])
def noop_credentials(_: any):
def noop_credentials(_: Any):
return lambda: {}

config = Config(host=host, credentials_strategy=noop_credentials)
Expand Down
8 changes: 4 additions & 4 deletions databricks/sdk/runtime/dbutils_stub.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class data:
"""

@staticmethod
def summarize(df: any, precise: bool = False) -> None:
def summarize(df: typing.Any, precise: bool = False) -> None:
"""Summarize a Spark/pandas/Koalas DataFrame and visualize the statistics to get quick insights.

Example: dbutils.data.summarize(df)
Expand Down Expand Up @@ -198,16 +198,16 @@ class taskValues:
def get(
taskKey: str,
key: str,
default: any = None,
debugValue: any = None,
default: Any = None,
debugValue: Any = None,
) -> None:
"""
Returns the latest task value that belongs to the current job run
"""
...

@staticmethod
def set(key: str, value: any) -> None:
def set(key: str, value: Any) -> None:
"""
Sets a task value on the current task run
"""
Expand Down
26 changes: 13 additions & 13 deletions databricks/sdk/service/_internal.py

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

6 changes: 3 additions & 3 deletions databricks/sdk/service/aisearch.py

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

4 changes: 2 additions & 2 deletions databricks/sdk/service/bundle.py

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

4 changes: 2 additions & 2 deletions databricks/sdk/service/bundledeployments.py

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

2 changes: 1 addition & 1 deletion databricks/sdk/service/serving.py

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

2 changes: 1 addition & 1 deletion docs/gen-client-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def _write_client_package_doc(self, folder: str, pkg: Package, services: list[st
if __name__ == '__main__':

@credentials_strategy('noop', [])
def noop_credentials(_: any):
def noop_credentials(_: Any):
return lambda: {}

gen = Generator()
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import functools
import os
import platform
from typing import Any

import pytest as pytest
from pyfakefs.fake_filesystem_unittest import Patcher
Expand All @@ -22,7 +23,7 @@ def stub_host_metadata(mocker):


@credentials_strategy("noop", [])
def noop_credentials(_: any):
def noop_credentials(_: Any):
return lambda: {}


Expand Down
18 changes: 9 additions & 9 deletions tests/databricks/sdk/service/jsonmarshallv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class OptionalFields:

legacy_timestamp: Optional[str] = None

list_value: Optional[List[any]] = None
list_value: Optional[List[Any]] = None

map: Optional[Dict[str, str]] = None
"""Lint disable reason: This is a dummy field used to test SDK Generation logic."""
Expand All @@ -111,13 +111,13 @@ class OptionalFields:

optional_string: Optional[str] = None

struct: Optional[Dict[str, any]] = None
struct: Optional[Dict[str, Any]] = None

test_enum: Optional[TestEnum] = None

timestamp: Optional[Timestamp] = None

value: Optional[any] = None
value: Optional[Any] = None

def as_dict(self) -> dict:
"""Serializes the OptionalFields into a dictionary suitable for use as a JSON request body."""
Expand Down Expand Up @@ -228,17 +228,17 @@ class RepeatedFields:

repeated_int64: Optional[List[int]] = None

repeated_list_value: Optional[List[List[any]]] = None
repeated_list_value: Optional[List[List[Any]]] = None

repeated_message: Optional[List[NestedMessage]] = None

repeated_string: Optional[List[str]] = None

repeated_struct: Optional[List[Dict[str, any]]] = None
repeated_struct: Optional[List[Dict[str, Any]]] = None

repeated_timestamp: Optional[List[Timestamp]] = None

repeated_value: Optional[List[any]] = None
repeated_value: Optional[List[Any]] = None

test_repeated_enum: Optional[List[TestEnum]] = None

Expand Down Expand Up @@ -344,11 +344,11 @@ class RequiredFields:

required_timestamp: Timestamp

required_value: any
required_value: Any

required_list_value: List[any]
required_list_value: List[Any]

required_struct: Dict[str, any]
required_struct: Dict[str, Any]

def as_dict(self) -> dict:
"""Serializes the RequiredFields into a dictionary suitable for use as a JSON request body."""
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/test_json_marshall.py

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

Loading
Loading