Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
ddl-s-ramirezayuso committed Feb 20, 2025
1 parent 3ae5fda commit 8a5684e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from http import HTTPStatus
from typing import Any, Dict, Optional, Union

from http import HTTPStatus

import httpx

from ... import errors
Expand Down
3 changes: 2 additions & 1 deletion datasource_api_client/api/proxy/get_key_url.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from http import HTTPStatus
from typing import Any, Dict, Optional, Union, cast

from http import HTTPStatus

import httpx

from ... import errors
Expand Down
3 changes: 2 additions & 1 deletion datasource_api_client/api/proxy/list_keys.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union, cast

from http import HTTPStatus

import httpx

from ... import errors
Expand Down
3 changes: 2 additions & 1 deletion datasource_api_client/api/proxy/log_metric.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from http import HTTPStatus
from typing import Any, Dict, Optional, Union

from http import HTTPStatus

import httpx

from ... import errors
Expand Down
23 changes: 7 additions & 16 deletions datasource_api_client/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ssl
from typing import Any, Dict, Optional, Union

import ssl

import httpx
from attrs import define, evolve, field

Expand Down Expand Up @@ -38,15 +39,11 @@ class Client:
_base_url: str = field(alias="base_url")
_cookies: Dict[str, str] = field(factory=dict, kw_only=True, alias="cookies")
_headers: Dict[str, str] = field(factory=dict, kw_only=True, alias="headers")
_timeout: Optional[httpx.Timeout] = field(
default=None, kw_only=True, alias="timeout"
)
_timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout")
_verify_ssl: Union[str, bool, ssl.SSLContext] = field(
default=True, kw_only=True, alias="verify_ssl"
)
_follow_redirects: bool = field(
default=False, kw_only=True, alias="follow_redirects"
)
_follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects")
_httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args")
_client: Optional[httpx.Client] = field(default=None, init=False)
_async_client: Optional[httpx.AsyncClient] = field(default=None, init=False)
Expand Down Expand Up @@ -174,15 +171,11 @@ class AuthenticatedClient:
_base_url: str = field(alias="base_url")
_cookies: Dict[str, str] = field(factory=dict, kw_only=True, alias="cookies")
_headers: Dict[str, str] = field(factory=dict, kw_only=True, alias="headers")
_timeout: Optional[httpx.Timeout] = field(
default=None, kw_only=True, alias="timeout"
)
_timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout")
_verify_ssl: Union[str, bool, ssl.SSLContext] = field(
default=True, kw_only=True, alias="verify_ssl"
)
_follow_redirects: bool = field(
default=False, kw_only=True, alias="follow_redirects"
)
_follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects")
_httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args")
_client: Optional[httpx.Client] = field(default=None, init=False)
_async_client: Optional[httpx.AsyncClient] = field(default=None, init=False)
Expand Down Expand Up @@ -249,9 +242,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None:
"""Exit a context manager for internal httpx.Client (see httpx docs)"""
self.get_httpx_client().__exit__(*args, **kwargs)

def set_async_httpx_client(
self, async_client: httpx.AsyncClient
) -> "AuthenticatedClient":
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
"""Manually the underlying httpx.AsyncClient
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
Expand Down
11 changes: 2 additions & 9 deletions datasource_api_client/types.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
"""Contains some shared types for properties"""

from typing import BinaryIO, Generic, Literal, MutableMapping, Optional, Tuple, TypeVar

from http import HTTPStatus
from typing import (
BinaryIO,
Generic,
Literal,
MutableMapping,
Optional,
Tuple,
TypeVar,
)

from attrs import define

Expand Down
18 changes: 1 addition & 17 deletions domino_data/configuration_gen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Code generated by gen.py; DO NOT EDIT.
This file was generated by robots at
2025-02-20 13:30:06.271414"""

from typing import Any, Dict, Optional, Union

from enum import Enum
Expand Down Expand Up @@ -150,7 +151,6 @@ class BigQueryConfig(Config):
class ClickHouseConfig(Config):
"""ClickHouseConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -173,12 +173,10 @@ class DatasetConfig(Config):
subfolder: Optional[str] = _config(elem=ConfigElem.SUBFOLDER)



@attr.s(auto_attribs=True)
class DB2Config(Config):
"""DB2Config datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -187,7 +185,6 @@ class DB2Config(Config):
class DruidConfig(Config):
"""DruidConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -205,7 +202,6 @@ class GCSConfig(Config):
class GenericJDBCConfig(Config):
"""GenericJDBCConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -227,7 +223,6 @@ class GenericS3Config(Config):
class GreenplumConfig(Config):
"""GreenplumConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -236,7 +231,6 @@ class GreenplumConfig(Config):
class IgniteConfig(Config):
"""IgniteConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -245,7 +239,6 @@ class IgniteConfig(Config):
class MariaDBConfig(Config):
"""MariaDBConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -254,7 +247,6 @@ class MariaDBConfig(Config):
class MongoDBConfig(Config):
"""MongoDBConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -277,7 +269,6 @@ class MySQLConfig(Config):
class NetezzaConfig(Config):
"""NetezzaConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -296,7 +287,6 @@ class OracleConfig(Config):
class PalantirConfig(Config):
"""PalantirConfig datasource configuration."""


client_id: Optional[str] = _cred(elem=CredElem.CLIENTID)
client_secret: Optional[str] = _cred(elem=CredElem.CLIENTSECRET)
o_auth_token: Optional[str] = _cred(elem=CredElem.OAUTHTOKEN)
Expand Down Expand Up @@ -347,7 +337,6 @@ class S3Config(Config):
class SAPHanaConfig(Config):
"""SAPHanaConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -356,7 +345,6 @@ class SAPHanaConfig(Config):
class SingleStoreConfig(Config):
"""SingleStoreConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand Down Expand Up @@ -389,7 +377,6 @@ class SnowflakeConfig(Config):
class SynapseConfig(Config):
"""SynapseConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -402,12 +389,10 @@ class TabularS3GlueConfig(Config):
region: Optional[str] = _config(elem=ConfigElem.REGION)



@attr.s(auto_attribs=True)
class TeradataConfig(Config):
"""TeradataConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand All @@ -427,7 +412,6 @@ class TrinoConfig(Config):
class VerticaConfig(Config):
"""VerticaConfig datasource configuration."""


username: Optional[str] = _cred(elem=CredElem.USERNAME)
password: Optional[str] = _cred(elem=CredElem.PASSWORD)

Expand Down

0 comments on commit 8a5684e

Please sign in to comment.