Skip to content

Commit 86a5265

Browse files
Correct use of any as a type to typing.Any
1 parent c4e0e6f commit 86a5265

16 files changed

Lines changed: 54 additions & 51 deletions

File tree

databricks/sdk/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pathlib
77
import re
88
import urllib.parse
9-
from typing import Dict, Iterable, List, Optional
9+
from typing import Any, Dict, Iterable, List, Optional
1010

1111
import requests
1212

@@ -49,7 +49,7 @@ def __get__(self, cfg: "Config", owner):
4949
return None
5050
return cfg._inner.get(self.name, None)
5151

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

5555
def __repr__(self) -> str:
@@ -580,7 +580,7 @@ def debug_string(self) -> str:
580580
buf.append(f"Env: {', '.join(envs_used)}")
581581
return ". ".join(buf)
582582

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

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

716-
def _set_inner_config(self, keyword_args: Dict[str, any]):
716+
def _set_inner_config(self, keyword_args: Dict[str, Any]):
717717
for attr in self.attributes():
718718
if attr.name not in keyword_args:
719719
continue

databricks/sdk/dbutils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ def get(
188188
self,
189189
taskKey: str,
190190
key: str,
191-
default: any = None,
192-
debugValue: any = None,
191+
default: Any = None,
192+
debugValue: Any = None,
193193
) -> None:
194194
"""
195195
Returns `debugValue` if present, throws an error otherwise as this implementation is always run outside of a job run
@@ -200,7 +200,7 @@ def get(
200200
)
201201
return debugValue
202202

203-
def set(self, key: str, value: any) -> None:
203+
def set(self, key: str, value: Any) -> None:
204204
"""
205205
Sets a task value on the current task run
206206
"""

databricks/sdk/logger/round_trip_logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def generate(self) -> str:
5555
return "\n".join(sb)
5656

5757
@staticmethod
58-
def _mask(m: Dict[str, any]):
58+
def _mask(m: Dict[str, Any]):
5959
for k in m:
6060
if k in {
6161
"bytes_value",
@@ -67,7 +67,7 @@ def _mask(m: Dict[str, any]):
6767
m[k] = "**REDACTED**"
6868

6969
@staticmethod
70-
def _map_keys(m: Dict[str, any]) -> List[str]:
70+
def _map_keys(m: Dict[str, Any]) -> List[str]:
7171
keys = list(m.keys())
7272
keys.sort()
7373
return keys

databricks/sdk/oauth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ def from_host(
789789
from .credentials_provider import credentials_strategy
790790

791791
@credentials_strategy("noop", [])
792-
def noop_credentials(_: any):
792+
def noop_credentials(_: Any):
793793
return lambda: {}
794794

795795
config = Config(host=host, credentials_strategy=noop_credentials)

databricks/sdk/runtime/dbutils_stub.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class data:
5555
"""
5656

5757
@staticmethod
58-
def summarize(df: any, precise: bool = False) -> None:
58+
def summarize(df: typing.Any, precise: bool = False) -> None:
5959
"""Summarize a Spark/pandas/Koalas DataFrame and visualize the statistics to get quick insights.
6060
6161
Example: dbutils.data.summarize(df)
@@ -198,16 +198,16 @@ class taskValues:
198198
def get(
199199
taskKey: str,
200200
key: str,
201-
default: any = None,
202-
debugValue: any = None,
201+
default: Any = None,
202+
debugValue: Any = None,
203203
) -> None:
204204
"""
205205
Returns the latest task value that belongs to the current job run
206206
"""
207207
...
208208

209209
@staticmethod
210-
def set(key: str, value: any) -> None:
210+
def set(key: str, value: Any) -> None:
211211
"""
212212
Sets a task value on the current task run
213213
"""

databricks/sdk/service/_internal.py

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks/sdk/service/aisearch.py

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks/sdk/service/bundle.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks/sdk/service/bundledeployments.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks/sdk/service/serving.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)