-
Notifications
You must be signed in to change notification settings - Fork 15
Prevent duplicated rule exception when importing rules and filters #87
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
Changes from 1 commit
9935c21
a352233
c3e5632
80b684f
50f7190
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -62,6 +62,9 @@ def _load(self, namespace_name: str) -> None: | |||||
| module = importlib.import_module(module_name) | ||||||
| for obj_name in dir(module): | ||||||
| obj = module.__dict__[obj_name] | ||||||
| # skip adding objects imported from other modules | ||||||
|
||||||
| # skip adding objects imported from other modules | |
| # Skip adding objects imported from other modules |
🤓
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.
Thanks, should be fixed now.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Package for testing discovery of imported rules and filters.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| """Imported rules and filters.""" | ||
|
|
||
| from tests.rules.imported.original import ( | ||
| rule_filter_to_be_imported, # noqa: F401 | ||
| rule_to_be_imported, # noqa: F401 | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| """Rules and filters to be imported.""" | ||
|
|
||
|
|
||
| from dbt_score import Model, RuleViolation, rule, rule_filter | ||
|
|
||
|
|
||
| @rule | ||
| def rule_to_be_imported(model: Model) -> RuleViolation | None: | ||
| """An example rule.""" | ||
|
|
||
|
|
||
| @rule_filter | ||
| def rule_filter_to_be_imported(model: Model) -> bool: # type: ignore[empty-body] | ||
| """An example filter.""" |
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ordering of objects has changed, because files were renamed:
|
Uh oh!
There was an error while loading. Please reload this page.