-
Notifications
You must be signed in to change notification settings - Fork 121
Initialize elementary graph even if disabled #906
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Yu Ishikawa <yu-iskw@users.noreply.github.com>
📝 WalkthroughWalkthroughAn initialization call for the elementary graph in the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
👋 @yu-iskw |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
macros/edr/system/hooks/on_run_start.sql
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: arbiv
Repo: elementary-data/dbt-data-reliability PR: 861
File: macros/edr/tests/test_utils/clean_elementary_test_tables.sql:45-50
Timestamp: 2025-09-15T06:06:05.601Z
Learning: In the Elementary dbt-data-reliability codebase, the team prefers simpler, direct approaches over creating helper macros for centralized quoting logic, even when it might provide better maintainability across multiple use cases. They value code simplicity and readability over abstraction.
🔇 Additional comments (1)
macros/edr/system/hooks/on_run_start.sql (1)
2-3: Good fix to prevent NoneType error when Elementary is disabled.The unconditional initialization before the early return (line 5) ensures the elementary graph object exists even when Elementary is disabled, which resolves the "'None' has no attribute 'update'" error. The
init_elementary_graph()macro usesgraph.setdefault(), which safely initializes the data structure on first call and is a no-op on subsequent calls, making unconditional initialization both safe and idempotent with no performance overhead.
|
@MikaKerman Sorry for bothering you, but I appreciate if you could review it. |
|
@yu-iskw, thanks for your contribution! |
|
@arbiv That sounds good. By doing so, we can cut off unnecessary computing resources if Elementary is disabled. What about implementing that in addition to pull request? I don't think the initialization causes bad side effects. And it can prevent issues like this case, even if we unconsciously change other macros. What do you think? |
I encountered the error, if Elementary is disabled at the version of
0.20.1. I think it would be good to initialize the elementary graph, even though Elementary is disabled.dbt-data-reliability/macros/edr/materializations/test/test.sql
Line 211 in 1f753cb
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.