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: add redshift connector #229

Merged
merged 6 commits into from
May 5, 2021
Merged

Conversation

bastienboutonnet
Copy link
Member

@bastienboutonnet bastienboutonnet commented Apr 29, 2021

Description

Adds an engine connection class to connect to Redshift

How was the change tested

Untested as I have no access to Redshift but will be tested by a member of the community.

Issue Information

Resolves #171

Checklist

(Ideally, all boxes are checked by the time we merged the PR, if you don't know how to do any of these don't hesitate to say so in the PR and we'll help you out.)

  • I formatted my PR name according to CONTRIBUTING.md
  • I added a news fragment to help populating the changelog as encouraged in CONTRIBUTING.md
  • I added "Closes #<issue_number>" in the "Issue Information" section (if no issue, feel free to tick thick the box anyway).

@codecov
Copy link

codecov bot commented Apr 29, 2021

Codecov Report

Merging #229 (266c890) into dev/0.1.0 (329e1d0) will decrease coverage by 0.05%.
The diff coverage is 86.66%.

Impacted file tree graph

@@              Coverage Diff              @@
##           dev/0.1.0     #229      +/-   ##
=============================================
- Coverage      82.53%   82.48%   -0.06%     
=============================================
  Files             19       20       +1     
  Lines           1197     1205       +8     
=============================================
+ Hits             988      994       +6     
- Misses           209      211       +2     
Flag Coverage Δ
unittests 82.48% <86.66%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dbt_sugar/core/connectors/redshift_connector.py 71.42% <71.42%> (ø)
dbt_sugar/__init__.py 100.00% <100.00%> (ø)
dbt_sugar/core/_version.py 100.00% <100.00%> (ø)
dbt_sugar/core/clients/dbt.py 95.00% <100.00%> (ø)
dbt_sugar/core/task/doc.py 67.85% <100.00%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 329e1d0...266c890. Read the comment docs.

@bastienboutonnet bastienboutonnet changed the base branch from main to dev/0.1.0 April 29, 2021 20:18
@bastienboutonnet
Copy link
Member Author

pre-commit.ci run

@bastienboutonnet bastienboutonnet force-pushed the feat/redshift_adaptor branch from abf7b3d to 266c890 Compare May 5, 2021 18:45
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 5, 2021

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.20%.

Quality metrics Before After Change
Complexity 4.89 ⭐ 4.91 ⭐ 0.02 👎
Method Length 64.00 🙂 64.21 🙂 0.21 👎
Working memory 9.40 🙂 9.48 🙂 0.08 👎
Quality 68.15% 🙂 67.95% 🙂 -0.20% 👎
Other metrics Before After Change
Lines 650 651 1
Changed files Quality Before Quality After Quality Change
dbt_sugar/init.py 100.00% ⭐ 100.00% ⭐ 0.00%
dbt_sugar/core/_version.py 100.00% ⭐ 100.00% ⭐ 0.00%
dbt_sugar/core/clients/dbt.py 75.61% ⭐ 75.17% ⭐ -0.44% 👎
dbt_sugar/core/task/doc.py 64.13% 🙂 64.06% 🙂 -0.07% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
dbt_sugar/core/task/doc.py DocumentationTask.check_tests 12 🙂 144 😞 15 😞 44.18% 😞 Try splitting into smaller methods. Extract out complex expressions
dbt_sugar/core/clients/dbt.py DbtProject.__init__.read_project.DbtProfile.read_profile 12 🙂 127 😞 12 😞 50.39% 🙂 Try splitting into smaller methods. Extract out complex expressions
dbt_sugar/core/task/doc.py DocumentationTask.update_model 14 🙂 96 🙂 13 😞 51.12% 🙂 Extract out complex expressions
dbt_sugar/core/task/doc.py DocumentationTask.document_columns 5 ⭐ 149 😞 12 😞 54.43% 🙂 Try splitting into smaller methods. Extract out complex expressions
dbt_sugar/core/task/doc.py DocumentationTask.update_model_description 7 ⭐ 81 🙂 13 😞 59.61% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@bastienboutonnet bastienboutonnet merged commit c70cce2 into dev/0.1.0 May 5, 2021
@bastienboutonnet bastienboutonnet deleted the feat/redshift_adaptor branch May 5, 2021 18:48
bastienboutonnet added a commit that referenced this pull request May 5, 2021
* feat: add describe table logic in snowflake connector (#212)

* implement `describe table` logic in SnowflakeConnector

* add flag for experimental feature in config

* update test expectations to have use_describe_snowflake False

* add use_describe_snowflake CLI arg parsing

* update cli consumption tests

* 'Refactored by Sourcery' (#213)

Co-authored-by: Sourcery AI <>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add changelog entry

* lowercase column names

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat: automatic insertion of primary key tests (#203)

* feat: automatic insertion of primary key tests.

* feat: adding tests

feat: adding tests

* feat: cleaning documentation

* feat: change the way of getting the SQL file

* Add new tests

* 'Refactored by Sourcery' (#216)

Co-authored-by: Sourcery AI <>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: adding changelog defintion primary key tests

* feat: adding changelog defintion primary key tests

* rename and rephrase news fragment (#219)

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bastien Boutonnet <bastien.b1@gmail.com>

* refactor: add use_describe to base (#236)

* add `use_describe` to the base `get_columns_from_table` def

* 'Refactored by Sourcery' (#237)

Co-authored-by: Sourcery AI <>

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* feat: bootstrap task (#233)

* setup arg parser and skeleton of bootstrap task

* implement barebone all dbt models dict building

* iterate through models and get col list and schema path

* combine getting columns and finding descriptor

* update tests for bootstrap_task

* update tests for audit_task

* add model placeholders in bootstrap_task

add all models placeholders

* refactor dbt models info in a dataclass for cleaner type checking

* feat: bootstrap task (Sourcery refactored) (#234)

* 'Refactored by Sourcery'

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Sourcery AI <>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix typo in new fragment

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat: allow audit task to run bootstrap (#239)

* add bootstrap option to `audit` and call it if passed

* add news fragement

* feat: collect rich user input for tests with subprocess (#238)

* feat: collect rich user input for tests with subprocess

* fix: order of the combine list

Make nicer the logs

Secure variable

* add: feature.md

* [pre-commit.ci] pre-commit autoupdate (#242)

updates:
- [github.com/psf/black: 21.4b0 → 21.4b2](psf/black@21.4b0...21.4b2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* add dbt sugar logo

* chore(deps): Bump sqlalchemy from 1.4.12 to 1.4.13 (#243)

Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 1.4.12 to 1.4.13.
- [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases)
- [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/master/CHANGES)
- [Commits](https://github.com/sqlalchemy/sqlalchemy/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): Bump pytest from 6.2.3 to 6.2.4 (#244)

* feat: add redshift connector (#229)

* add RedshiftConnector engine creation module

* add news fragment

* move pytest-dictsdiff to dev requirements

* make read_profile use PostgresDbtProfilesModel pydantic validation class

* 'Refactored by Sourcery' (#231)

Co-authored-by: Sourcery AI <>

* Bump version: 0.0.0 → 0.1.0-a.0

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: virvirlopez <virbyte@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

Test/write a connector for redshift
1 participant