-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create rule registry and discovery #5
Conversation
Before diving into the code: could you maybe add a some documentation to explain how rule registry works in our package? We will need the documentation anyway, and it will help our reviewing efforts! |
Can you let me know what you are lacking? Hopefully the docstrings are already helpful. |
Yeah I should be able to understand it. Makes sense to write the docs when it is set in stone, I will use the docstrings etc. 👍 |
47282ba
to
de7cbc6
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.
Looks good, works very well locally! 🤩 Just left a few comments with some questions. Also you can make the changes to comply with the new Rule definitions that were merged into master.
src/dbt_score/registry.py
Outdated
|
||
from dbt_score.exceptions import DuplicatedRuleException | ||
|
||
THIRD_PARTY_RULES_NAMESPACE = "dbt_score_rules" |
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.
I am trying to understand the expected behavior. Is it correct that this folder should be in the root of the project where users want to run dbt-score
? As I understand, this folder can not live for example in a subdirectory. Not sure if this makes sense, we can discuss
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.
It doesn't assume any folder structure, but the presence of the namespace dbt_score_rules
in the Python path (which can live anywhere, as long as it's known by Python at run time). Does that make sense?
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.
💅
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.
💪
Left a minor comment
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.
🚀
The rule registry has 2 purposes:
By default, the rule registry looks for rules in 2 places:
dbt_score.rules
, the "core" rules of dbt-scoredbt_score_rules
, a namespace that anyone can use to add custom rules