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

feat: Issue339 ldap logmech #347

merged 7 commits into from
Dec 10, 2021

Conversation

wanting4
Copy link
Contributor

@wanting4 wanting4 commented Nov 19, 2021

Close #339

@wanting4 wanting4 changed the title Issue339 ldap logmech feat: Issue339 ldap logmech Nov 19, 2021
Copy link
Collaborator

@nehanene15 nehanene15 left a 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)
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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):
Copy link
Collaborator

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):

Copy link
Contributor Author

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

Copy link
Collaborator

@nehanene15 nehanene15 left a 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)
Copy link
Collaborator

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):
Copy link
Collaborator

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?

@@ -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",
Copy link
Collaborator

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)
Copy link
Collaborator

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep!

third_party/ibis/ibis_teradata/client.py Show resolved Hide resolved
@wanting4 wanting4 merged commit ad7f1fc into develop Dec 10, 2021
@wanting4 wanting4 deleted the issue339-LDAP-logmech branch December 10, 2021 20:20
mrriteshranjan added a commit to mrriteshranjan/professional-services-data-validator that referenced this pull request Dec 30, 2021
@Brandt-Wilson
Copy link

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.

@nehanene15
Copy link
Collaborator

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

@Brandt-Wilson
Copy link

Brandt-Wilson commented Dec 2, 2022 via email

@nehanene15
Copy link
Collaborator

The bug fix has been merged to the develop branch. You could pull the latest changes and package via pip install . or wait for the next Pypi release for 2.7.0 in two weeks or so.

@Brandt-Wilson
Copy link

Brandt-Wilson commented Dec 5, 2022 via email

@nehanene15
Copy link
Collaborator

Yes, 'develop' is our main branch. You can run git pull https://github.com/GoogleCloudPlatform/professional-services-data-validator.git, go into the professional-services-data-validator directory, and package the latest code with pip install .

@Brandt-Wilson
Copy link

Hi, when is next version being implemented?

@nehanene15
Copy link
Collaborator

Hi, we just released a new version today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Teradata logmech should also support LDAP
3 participants