Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Issue339 ldap logmech #347

Merged
merged 7 commits into from
Dec 10, 2021
Merged
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
1 change: 1 addition & 0 deletions data_validation/cli_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
["port", "Teradata port to connect on"],
["user_name", "User used to connect"],
["password", "Password for supplied user"],
["logmech", "Log on mechanism"],
],
"Oracle": [
["host", "Desired Oracle host"],
Expand Down
3 changes: 2 additions & 1 deletion docs/connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data-validation connections add --connection-name MY_BQ_CONN BigQuery --project-

## Create a sample Teradata connection:
```
data-validation connections add --connection-name MY_TD_CONN Teradata --host HOST_IP --port PORT --user_name USER_NAME --password PASSWORD
data-validation connections add --connection-name MY_TD_CONN Teradata --host HOST_IP --port PORT --user-name USER-NAME --password PASSWORD
```

## List existing connections
Expand Down Expand Up @@ -129,6 +129,7 @@ via `pip install teradatasql` if you have a license.
# Connection Details
"host": "127.0.0.1",
"port":1025,
"logmech":"TD2",
"user_name":"my-user",
"password":"my-password"
}
Expand Down
6 changes: 4 additions & 2 deletions third_party/ibis/ibis_teradata/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def verify(expr, params=None):


def connect(
host: str, user_name: str, password: str, port: Optional[int] = 1025
host: str, user_name: str, password: str, port: Optional[int] = 1025, logmech: Optional[str]='TD2'
) -> TeradataClient:
""" Create a TeradataClient for use with Ibis.
Parameters
Expand All @@ -51,9 +51,11 @@ def connect(
Password for supplied username
port : Optional[int]
The database port to connect to (default. 1025)
logmech : Optional[str]
Logmech flag to select with (default. TD2)
Returns
-------
TeradataClient
"""

return TeradataClient(host, user_name, password, port)
return TeradataClient(host, user_name, password, port, logmech)
5 changes: 4 additions & 1 deletion third_party/ibis/ibis_teradata/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TeradataClient(SQLClient):
table_class = TeradataTable
dialect = compiler.TeradataDialect

def __init__(self, host, user_name, password, port=1025, use_no_lock_tables=False):
def __init__(self, host, user_name, password, port=1025, logmech='TD2', use_no_lock_tables=False):
"""Construct a TeradataClient.
Parameters
nehanene15 marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -79,12 +79,15 @@ def __init__(self, host, user_name, password, port=1025, use_no_lock_tables=Fals
Password for supplied username
port : Optional[int]
The database port to connect to (default. 1025)
logmech : Optional[int]
The logmech type to connect to (default. TD2)
"""
self.teradata_config = {
"host": host,
"user": user_name,
"password": password,
"dbs_port": port,
"logmech": logmech,
}

self.client = teradatasql.connect(**self.teradata_config)
Expand Down