Skip to content

Conversation

@ofek1weiss
Copy link
Contributor

@ofek1weiss ofek1weiss commented Sep 1, 2025

the -m flag was deprecated in favor of -s in 2021
https://docs.getdbt.com/reference/deprecations#modelparamusagedeprecation
removed its usage in the project

Summary by CodeRabbit

  • Refactor
    • Standardized dbt run filtering to use select/selector; removed models-based filtering.
    • Updated alerting workflows to use select while maintaining existing behavior.
    • Breaking change: scripts or integrations passing models must switch to select or selector.
    • Other options (full_refresh, vars, quiet, capture_output) remain unchanged.
    • Improves consistency with dbt conventions and simplifies the public API.

@linear
Copy link

linear bot commented Sep 1, 2025

@ofek1weiss ofek1weiss temporarily deployed to elementary_test_env September 1, 2025 09:15 — with GitHub Actions Inactive
@coderabbitai
Copy link

coderabbitai bot commented Sep 1, 2025

Walkthrough

Removed the models argument from CommandLineDbtRunner.run and its command construction. Updated DataMonitoringAlerts to pass select instead of models when invoking dbt run for alerts_v2. No other logic paths changed.

Changes

Cohort / File(s) Summary
DBT runner API update
elementary/clients/dbt/command_line_dbt_runner.py
Removed models parameter from CommandLineDbtRunner.run; eliminated -m flag handling; run now accepts select, selector, full_refresh, vars, quiet, capture_output only.
Call site adjustment
elementary/monitor/data_monitoring/alerts/data_monitoring_alerts.py
In _populate_data, replaced models=... with select=... when calling dbt_runner.run for elementary_cli.alerts.alerts_v2; other args unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Scheduler as Scheduler/Caller
  participant Alerts as DataMonitoringAlerts
  participant DbtRunner as CommandLineDbtRunner
  participant dbt as dbt CLI

  Scheduler->>Alerts: _populate_data()
  Alerts->>DbtRunner: run(select="elementary_cli.alerts.alerts_v2", full_refresh?, vars?)
  note over Alerts,DbtRunner: Parameter changed from models → select
  DbtRunner->>dbt: dbt run --select=<value> [--full-refresh] [--vars ...]
  dbt-->>DbtRunner: exit code / output
  DbtRunner-->>Alerts: success/failure
  Alerts-->>Scheduler: return
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nudge my nose at CLI skies,
Hop-hop! The models flag good-bye flies.
Select now guides my moonlit run,
A tidy trail, the work still done.
Ears up, logs hum, stars reflect—
Rabbits prefer a clean select. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch app-51-remove-deprecated-models-usage

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2025

👋 @ofek1weiss
Thank you for raising your pull request.
Please make sure to add tests and document all user-facing changes.
You can do this by editing the docs files in this pull request.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
elementary/monitor/data_monitoring/alerts/data_monitoring_alerts.py (2)

105-113: Nit: avoid shadowing the built-in name vars

Minor readability/pitfall. Rename the local vars to avoid shadowing Python’s built-in function.

-        vars = dbt_vars or dict()
-        if days_back:
-            vars.update(days_back=days_back)
+        dbt_vars_resolved = (dbt_vars or {}).copy()
+        if days_back:
+            dbt_vars_resolved["days_back"] = days_back
         success = self.internal_dbt_runner.run(
             select="elementary_cli.alerts.alerts_v2",
             full_refresh=dbt_full_refresh,
-            vars=vars,
+            vars=dbt_vars_resolved,
         )

391-401: Typo: popopulated_data_successfullypopulated_data_successfully

Cosmetic but noisy for readers and tooling.

-            popopulated_data_successfully = self._populate_data(
+            populated_data_successfully = self._populate_data(
                 days_back=days_back,
                 dbt_full_refresh=dbt_full_refresh,
                 dbt_vars=dbt_vars,
             )
-            if not popopulated_data_successfully:
+            if not populated_data_successfully:
                 self.success = False
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 133b631 and 38913e8.

📒 Files selected for processing (2)
  • elementary/clients/dbt/command_line_dbt_runner.py (0 hunks)
  • elementary/monitor/data_monitoring/alerts/data_monitoring_alerts.py (1 hunks)
💤 Files with no reviewable changes (1)
  • elementary/clients/dbt/command_line_dbt_runner.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test / test
  • GitHub Check: code-quality
🔇 Additional comments (2)
elementary/monitor/data_monitoring/alerts/data_monitoring_alerts.py (2)

109-113: LGTM: switch from models→select aligns with dbt deprecation

Using select="elementary_cli.alerts.alerts_v2" matches the updated CommandLineDbtRunner.run signature and the dbt -s flag. No functional regressions apparent.


109-113: No remaining dbt -m or run(models=…) usage
Verified no occurrences in code or CI scripts; the only -m flags found in docs are standard Python module invocations (e.g., python3 -m venv, python3 -m pip install), not dbt commands.

@ofek1weiss ofek1weiss merged commit 0cd4382 into master Sep 1, 2025
6 checks passed
@ofek1weiss ofek1weiss deleted the app-51-remove-deprecated-models-usage branch September 1, 2025 11:43
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.

3 participants