-
Notifications
You must be signed in to change notification settings - Fork 186
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
Update db2_data_source.py #2063
Conversation
This is needed in order to fix the connectivity issues for db2 from soda-core
for more information, see https://pre-commit.ci
once the approvals are done and the changes are approved, how soon can this be added to the new release? |
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.
changes look good to me, adding this self.verify_ssl = data_source_properties.get("security") in line 68 and updating conn_str in line 72 or 73 as below
conn_str = f"DATABASE={self.database};HOSTNAME={self.host};PORT={self.port};UID={self.username};PWD={self.password};SECURITY={self.verify_ssl}"
@m1n0 @vijaykiran Hi Milan as per our discussions earlier can you please review this PR and approve it and merge it for release? |
Hi @4rahulae, thanks for your contribution 🙌 @m1n0 is currently traveling back from our company offsite, so he'll likely not reach out today. I'm myself not able to test this at the moment, but could you assist by verifying that your changes do not impact configurations where (For example a possible scenario could be that Python translates it into an empty string or None, triggering DB2 to fail) |
Hi @dirkgroenen i did verify the backward compatibility by not defining security in the configuration.yml and the scan doesn't fail except that it returns with a message "[IBM][CLI Driver] SQL30081N A communication error has been detected" which only applies to my use case and after adding security: SSL it works. I believe in other scenarios when security is not defined it will default to None or empty string and if defining security is not needed it should still work |
thanks for the contrib @4rahulae ! I would suggest a bit more conservative way to do this though - pythons |
Hi @m1n0 are you suggesting doing something like below?. self.verify_ssl = data_source_properties.get("verify_ssl","SSL") This way there is no need to define security in the config file , i have tested this and it works. Please suggest if you have other ways to make this work as of right now i see this is the only other option that works apart from the suggested option earlier as part of pull request? |
hi, I don't know what the default value for
|
adding security as part of the config for db2, security will be added to the connection string only when it is not empty. This is needed in order to establish a connection with db2
remove security from the 1st connection string
for more information, see https://pre-commit.ci
Hi @m1n0 added changes as per your suggestion and tested them successfully on my local, please review the changes and let me know if it looks good to be merged and added for release? |
Thanks for the contrib, merging! |
Quality Gate passedIssues Measures |
* Update db2_data_source.py This is needed in order to fix the connectivity issues for db2 from soda-core * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update db2_data_source.py adding security as part of the config for db2, security will be added to the connection string only when it is not empty. This is needed in order to establish a connection with db2 * Update db2_data_source.py remove security from the 1st connection string * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Milan Lukac <m1n0@users.noreply.github.com>
This is needed in order to fix the connectivity issues for db2 from soda-core.
Please add this change as part of the soda-core release