This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change logic mapping external databases
- Loading branch information
Showing
17 changed files
with
312 additions
and
784 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
|
||
@dataclass | ||
class Column: | ||
def __init__( | ||
self, | ||
id: str, | ||
name: str, | ||
is_nullable: bool, | ||
remote_type: str = None, | ||
description: str = None, | ||
): | ||
self.id = id | ||
self.name = name | ||
self.remote_type = remote_type | ||
self.is_nullable = is_nullable | ||
self.description = description or None | ||
id: str | ||
name: str | ||
is_nullable: bool | ||
remote_type: Optional[str] = None | ||
description: Optional[str] = None | ||
|
||
@staticmethod | ||
def from_response(response): | ||
return Column( | ||
response.get("id"), | ||
response.get("name"), | ||
response.get("isNullable"), | ||
response.get("remoteType"), | ||
response.get("description"), | ||
@classmethod | ||
def from_dict(cls, **data) -> "Column": | ||
return cls( | ||
data["id"], | ||
data["name"], | ||
data["isNullable"], | ||
data.get("remoteType"), | ||
data.get("description"), | ||
) |
23 changes: 23 additions & 0 deletions
23
odd_collector/adapters/tableau/domain/connection_params.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
|
||
@dataclass | ||
class ConnectionParams: | ||
id: str | ||
name: str | ||
connection_type: str | ||
host: str | ||
port: int | ||
service: Optional[str] | ||
|
||
@classmethod | ||
def from_dict(cls, **kwargs): | ||
return cls( | ||
id=kwargs["id"], | ||
name=kwargs["name"], | ||
connection_type=kwargs["connectionType"], | ||
host=kwargs["hostName"], | ||
port=kwargs["port"], | ||
service=kwargs["service"], | ||
) |
Oops, something went wrong.