-
Notifications
You must be signed in to change notification settings - Fork 109
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add this to our Teradata connection documentation under docs/connections.md
port : Optional[int] | ||
The database port to connect to (default. 1025) | ||
Returns | ||
------- | ||
TeradataClient | ||
""" | ||
|
||
return TeradataClient(host, user_name, password, port) | ||
return TeradataClient(host, user_name, password, logmech, port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work since the TeradataClient init method takes the parameters in a different order. I would put logmech after port and make it Optional. The teradatasql.connect() documentation shows that "TD2" should be the default logmech
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in the new commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logmech is still before port. When instantiating a TeradataClient class, this will fail.
@@ -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, use_no_lock_tables=False, logmech): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you go with my suggestion to put the logmech after the port, this will need to be re-ordered like so:
def __init__(self, host, user_name, password, port=1025, logmech="TD2", use_no_lock_tables=False):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! updated in the new commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still some errors in the code. Could you please test and make sure it works before re-requesting review?
port : Optional[int] | ||
The database port to connect to (default. 1025) | ||
Returns | ||
------- | ||
TeradataClient | ||
""" | ||
|
||
return TeradataClient(host, user_name, password, port) | ||
return TeradataClient(host, user_name, password, logmech, port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logmech is still before port. When instantiating a TeradataClient class, this will fail.
@@ -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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if default arguments can be written in double quotes. Pretty sure it has to be logmech='TD2'
. Have you tested supplying this parameter and making sure it works?
docs/connections.md
Outdated
@@ -129,7 +129,8 @@ via `pip install teradatasql` if you have a license. | |||
# Connection Details | |||
"host": "127.0.0.1", | |||
"port":1025, | |||
"user_name":"my-user", | |||
"logmech":"TD2", | |||
"user-name":"my-user", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work since in the connection config JSON expects an underscore. For adding a connection via CLI, we expect a hyphen and the code in cli_tools manages that. Could you revert this change?
Instead, there is a bug in the connections documentation here that uses a flag with an underscore instead of a hyphen. We need to change that to --user-name
.
@@ -49,11 +49,13 @@ def connect( | |||
A Database username to connect with | |||
password : str | |||
Password for supplied username | |||
logmech : Optional[str] | |||
Logmech flag to select with (default. TD2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Can we update this to reflect the order of the parameters? (logmech after port)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep!
This reverts commit ad7f1fc.
Are you able to comment on why logmech was removed from the data validator? We tested this feature internally, and delivered initial code enhancement to google. We have been using this feature for 1+ years against Teradata. If we upgrade to the latest version it is stripped out. |
This was unintentional Seems like this line in cli_tools was mistakenly deleted. The rest of the framework is still in place. I will add that line back in PR #637 |
The bug fix has been merged to the develop branch. You could pull the latest changes and package via |
Yes, 'develop' is our main branch. You can run |
Hi, when is next version being implemented? |
Hi, we just released a new version today. |
Close #339