Skip to content

fix: init audit after bootstrap in the --bootstrap run#252

Merged
bastienboutonnet merged 5 commits intomainfrom
fix/audit_not_finding_recent_bootstrap
May 5, 2021
Merged

fix: init audit after bootstrap in the --bootstrap run#252
bastienboutonnet merged 5 commits intomainfrom
fix/audit_not_finding_recent_bootstrap

Conversation

@bastienboutonnet
Copy link
Member

@bastienboutonnet bastienboutonnet commented May 5, 2021

Description

When running audit --bootstrap while the bootstrap was running successfully, we were initialising the audit task before the bootstrap task. Since the audit task builds its knowledge of dbt models and their descriptions at __init__() time, the bootstrapped model descriptors were not yet available.

This PR moves the initialisation of audit task to after the bootstrap task has run.

How was the change tested

Tested interactively

Issue Information

(If your PR addresses or closes a GitHub issue please write "Closes #<issue_number>" or something like that).

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

@bastienboutonnet bastienboutonnet marked this pull request as draft May 5, 2021 20:28
@codecov
Copy link

codecov bot commented May 5, 2021

Codecov Report

Merging #252 (495699c) into main (75368b3) will not change coverage.
The diff coverage is 40.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #252   +/-   ##
=======================================
  Coverage   82.48%   82.48%           
=======================================
  Files          20       20           
  Lines        1205     1205           
=======================================
  Hits          994      994           
  Misses        211      211           
Flag Coverage Δ
unittests 82.48% <40.00%> (ø)

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

Impacted Files Coverage Δ
dbt_sugar/core/main.py 70.40% <0.00%> (ø)
dbt_sugar/core/task/doc.py 67.85% <0.00%> (ø)
dbt_sugar/__init__.py 100.00% <100.00%> (ø)
dbt_sugar/core/_version.py 100.00% <100.00%> (ø)

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 75368b3...495699c. Read the comment docs.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 5, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.01%.

Quality metrics Before After Change
Complexity 4.98 ⭐ 4.98 ⭐ 0.00
Method Length 80.83 🙂 80.79 🙂 -0.04 👍
Working memory 10.31 😞 10.31 😞 0.00
Quality 62.53% 🙂 62.54% 🙂 0.01% 👍
Other metrics Before After Change
Lines 738 743 5
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/main.py 58.38% 🙂 58.38% 🙂 0.00%
dbt_sugar/core/task/doc.py 64.06% 🙂 64.07% 🙂 0.01% 👍

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 🙂 143 😞 15 😞 44.29% 😞 Try splitting into smaller methods. Extract out complex expressions
dbt_sugar/core/main.py handle 8 ⭐ 193 😞 11 😞 49.20% 😞 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 marked this pull request as ready for review May 5, 2021 20:38
@bastienboutonnet bastienboutonnet merged commit 6e6c595 into main May 5, 2021
@bastienboutonnet bastienboutonnet deleted the fix/audit_not_finding_recent_bootstrap branch May 5, 2021 20:44
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.

1 participant