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

[MAINTENANCE] Placing AWS RedShift Imports Under Compatibility Pattern #8205

Conversation

alexsherstinsky
Copy link
Contributor

Scope

  • Instead of having plain imports of sqlalchemy_redshift, they are placed under the established "Compatibility" coding pattern.

Remarks

  • JIRA: DX-1/DX-440
  • Description of PR changes above includes a link to an existing GitHub issue

  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB]

  • Code is linted

    black .
    
    ruff . --fix
    
  • Appropriate tests and docs have been updated

For more details, see our Contribution Checklist, Coding style guide, and Documentation style guide.

After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!

Alex Sherstinsky added 2 commits June 28, 2023 09:44
…ink/update_not_imported_mechanism_to_use_scoped_compatibility_modules_instead-2023_06_28-50
@netlify
Copy link

netlify bot commented Jun 28, 2023

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit f99b5e5
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/649ca6b47136030008ba1fb5

…ink/update_not_imported_mechanism_to_use_scoped_compatibility_modules_instead-2023_06_28-50
@alexsherstinsky alexsherstinsky marked this pull request as ready for review June 28, 2023 17:38
@alexsherstinsky alexsherstinsky changed the title [MAINTENANCE] Placing S3, Trino Imports Under Compatibility Pattern [MAINTENANCE] Placing AWS RedShift Imports Under Compatibility Pattern Jun 28, 2023
@alexsherstinsky alexsherstinsky requested a review from a team June 28, 2023 17:39
@alexsherstinsky alexsherstinsky enabled auto-merge (squash) June 28, 2023 17:39
@ghost
Copy link

ghost commented Jun 28, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

Alex Sherstinsky added 2 commits June 28, 2023 11:54
…ink/update_not_imported_mechanism_to_use_scoped_compatibility_modules_instead-2023_06_28-50
Comment on lines 261 to 262
else:
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

nit (non-blocking): I don't think the else pass is required

Suggested change
else:
pass

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TrangPham Great catch -- deleted. Thanks!

try:
import sqlalchemy_redshift
except ImportError:
sqlalchemy_redshift = AWS_NOT_IMPORTED
Copy link
Contributor

Choose a reason for hiding this comment

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

I think within the same file is fine. Perhaps a different error message would be better as to not tell user to install something they may not require

Suggested change
sqlalchemy_redshift = AWS_NOT_IMPORTED
sqlalchemy_redshift = NotImported(
"Redshift connection components are not installed, please 'pip install sqlalchemy_redshift'"
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TrangPham Different message created -- thanks!

@alexsherstinsky alexsherstinsky force-pushed the maintenance/DX-1/DX-440/alexsherstinsky/link/update_not_imported_mechanism_to_use_scoped_compatibility_modules_instead-2023_06_28-50 branch from 126fa3c to a191d06 Compare June 28, 2023 19:43
Alex Sherstinsky and others added 2 commits June 28, 2023 12:46
…e_not_imported_mechanism_to_use_scoped_compatibility_modules_instead-2023_06_28-50
…e_not_imported_mechanism_to_use_scoped_compatibility_modules_instead-2023_06_28-50
@alexsherstinsky alexsherstinsky merged commit 13e2ae7 into develop Jun 28, 2023
48 checks passed
@alexsherstinsky alexsherstinsky deleted the maintenance/DX-1/DX-440/alexsherstinsky/link/update_not_imported_mechanism_to_use_scoped_compatibility_modules_instead-2023_06_28-50 branch June 28, 2023 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants