-
Notifications
You must be signed in to change notification settings - Fork 59
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
Modify RedshiftConnectionManager to extend from SQLConnectionManager, migrate from psycopg2 to redshift python connector #251
Conversation
… define a _get_connect_method method to leverage Redshift python connector to retrieve the connect method
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin. CLA has not been signed by users: @sathiish-kumar |
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin. CLA has not been signed by users: @sathiish-kumar |
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin. CLA has not been signed by users: @sathiish-kumar |
…h due to in-built support in Redshift Python Connector
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin. CLA has not been signed by users: @sathiish-kumar |
dbt/adapters/redshift/connections.py
Outdated
keepalives_idle: int = 4 | ||
iam_duration_seconds: Optional[ | ||
int | ||
] = 900 # TODO:Not supported in redshift python connector, should we remove this? |
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 it doesn't support these options is it because it's no longer needed or because the functionality isn't supported?
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 is obfuscated from the users of redshift python connector, it's managed by redshift connector whenever we want to use IAM profile as the mode of authn. In essence, no longer needed.
|
||
@classmethod | ||
def get_response(cls, cursor: redshift_connector.Cursor) -> AdapterResponse: | ||
rows = cursor.rowcount |
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.
@colin-rogers-dbt to follow-up on the removal of cursor.statusmessage
in get_response
dbt/adapters/redshift/connections.py
Outdated
connect_timeout: int = 10 | ||
role: Optional[str] = None | ||
sslmode: Optional[str] = None | ||
sslcert: Optional[ |
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.
@colin-rogers-dbt to follow-up on sslcert
, sslrootcert
and sslkey
usage and if it's really needed to be kept.
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.
cc: @jtcohen6 &@Fleid
Looking around I don't think this is being used (and I don't think it even makes sense for redshift anyways) so we can probably remove. AFAIK I don't think having extra values in the profile.yml will break anything but we should probably add a warning that it's no longer utilized?
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.
Not being used to my knowledge. Confirmed that users will not see an error if they add extra unused / unrecognized values into profiles.yml
. I think a deprecation warning is reasonable, given that these were previously documented.
1dc3ebe
to
d3113ca
Compare
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.
two nits but otherwise this should be good to go
waiting on some other large changes to merge this |
\o/ |
… migrate from psycopg2 to redshift python connector (dbt-labs#251) * Change RedshiftConnectionManager to extend from SQLConnectionManager, define a _get_connect_method method to leverage Redshift python connector to retrieve the connect method * Add/fix unit tests, create RedshiftConnectMethodFactory to vend connect_method * Fix _connection_keys to mimic PostgresConnectionManager * Remove unneeded functions for tmp_cluster_creds and env_var creds auth due to in-built support in Redshift Python Connector * Resolve some TODOs * Fix references to old exceptions, add changelog * Fix errors with functional tests by overriding add_query & execute and modifying multi statement execution * Attempt to fix integration tests by adding `valid_incremental_strategies` in impl.py * Fix unit tests * Attempt to fix integration tests * add unit tests for execute * add unit tests for add_query * make get_connection_method work with serverless * add unit tests for serverless iam connections * add redshift connector version, remove sslmode, connection time out, role, application_name * change redshift_connector version --------- Co-authored-by: jiezhec <[email protected]> Co-authored-by: colin-rogers-dbt <[email protected]>
define a _get_connect_method method to leverage Redshift python connector to retrieve the connect method
resolves #219
Description
This is a draft PR to solicit opinions on the changes that would help in the eventual migration to Redshift python connector from psycopg2 connector. Due to its draft nature, the PR doesn't have any tests.
RedshiftConnectionManager
fromSQLConnectionManager
SQLConnectionManager
_get_connect_method
method to provide low-level Redshift Python Connector based connection methods for establishing ConnectionsChecklist
changie new
to create a changelog entry