Skip to content

fix: pass warehouse dialect to altimate-core tools instead of hardcoding snowflake#550

Open
VJ-yadav wants to merge 1 commit intoAltimateAI:mainfrom
VJ-yadav:fix/hardcoded-snowflake-dialect
Open

fix: pass warehouse dialect to altimate-core tools instead of hardcoding snowflake#550
VJ-yadav wants to merge 1 commit intoAltimateAI:mainfrom
VJ-yadav:fix/hardcoded-snowflake-dialect

Conversation

@VJ-yadav
Copy link
Copy Markdown

Summary

Fixes #455 — Adds optional dialect parameter (default: "snowflake") to all 8 altimate-core tools that were hardcoding it:

  • altimate-core-validate.ts, fix.ts, correct.ts, semantics.ts, equivalence.ts, policy.ts, check.ts
  • impact-analysis.ts

Each tool now accepts dialect via zod schema, passes it to the Dispatcher call, and includes it in telemetry metadata. Follows the pattern already established in sql-analyze.ts, sql-optimize.ts, and schema-diff.ts.

Type interfaces updated in types.ts. Tests updated to pass dialect explicitly.

Test Plan

  • bun turbo typecheck — 5/5 packages pass
  • bun test test/altimate/schema-finops-dbt.test.ts — 56 pass
  • bun test test/altimate/tool-error-propagation.test.ts — 22 pass
  • Manual: run tools with dialect: "postgres" and verify it reaches telemetry

Checklist

  • Follows existing pattern from sql-analyze/optimize/schema-diff
  • Default value preserves backward compatibility
  • No breaking changes
  • Tests updated

…ing snowflake

Add optional `dialect` parameter (default: "snowflake") to all 8
altimate-core tools that were missing it:

- altimate-core-validate, fix, correct, semantics,
  equivalence, policy, check, and impact-analysis

Each tool now:
1. Accepts `dialect` via its zod parameter schema
2. Passes it through to the Dispatcher call
3. Includes it in telemetry metadata

Follows the pattern established in sql-analyze.ts, sql-optimize.ts,
and schema-diff.ts. Type interfaces updated in types.ts.
Tests updated to pass dialect explicitly.

Fixes AltimateAI#455

Co-Authored-By: Vijay Yadav <[email protected]>
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

Warning

Rate limit exceeded

@VJ-yadav has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 32 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 17 minutes and 32 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 538fd4b2-e896-4f57-9667-c8d87a05175d

📥 Commits

Reviewing files that changed from the base of the PR and between 33c331b and 3a58d84.

📒 Files selected for processing (11)
  • packages/opencode/src/altimate/native/types.ts
  • packages/opencode/src/altimate/tools/altimate-core-check.ts
  • packages/opencode/src/altimate/tools/altimate-core-correct.ts
  • packages/opencode/src/altimate/tools/altimate-core-equivalence.ts
  • packages/opencode/src/altimate/tools/altimate-core-fix.ts
  • packages/opencode/src/altimate/tools/altimate-core-policy.ts
  • packages/opencode/src/altimate/tools/altimate-core-semantics.ts
  • packages/opencode/src/altimate/tools/altimate-core-validate.ts
  • packages/opencode/src/altimate/tools/impact-analysis.ts
  • packages/opencode/test/altimate/e2e-tool-errors.ts
  • packages/opencode/test/altimate/tool-error-propagation.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@dev-punia-altimate
Copy link
Copy Markdown

🤖 Behavioral Analysis — 4 Finding(s)

🟡 Warnings (3)

  • FINDING-001 packages/opencode/src/altimate/tools/altimate-core-validate.ts:20 [logic_error]
    The early-return 'NO SCHEMA' path (the if (noSchema) guard before the try block) returns metadata without the dialect field, while all other return paths in this file are updated to include dialect. When noSchema is true the function returns metadata: { success: false, valid: false, has_schema: false, error } — omitting dialect. This is inconsistent with the PR's goal of including dialect in all telemetry metadata; the most common early-failure case (no schema provided) will have dialect missing.

  • FINDING-002 packages/opencode/src/altimate/tools/altimate-core-semantics.ts:21 [logic_error]
    Same issue as FINDING-001: the early-return 'NO SCHEMA' path (if (!hasSchema) guard before the try block) returns metadata without dialect. The PR only adds dialect to the Dispatcher.call, success, and catch paths. The early-return returns metadata: { success: false, valid: false, issue_count: 0, has_schema: false, error } — missing dialect.

  • FINDING-003 packages/opencode/src/altimate/tools/altimate-core-equivalence.ts:22 [logic_error]
    Same issue: the early-return 'NO SCHEMA' path returns metadata without dialect. The if (!hasSchema) guard returns metadata: { success: false, equivalent: false, has_schema: false, error } — missing dialect. The PR adds dialect to the other paths but misses this one.

🔵 Nits (1)

  • FINDING-004 packages/opencode/src/altimate/tools/impact-analysis.ts:38 [consistency]
    The two operational early-return paths in impact-analysis.ts — 'NO MANIFEST' (when manifest is empty) and 'MODEL NOT FOUND' (when target model is not found in the DAG) — return bare metadata: { success: false } objects without dialect or other telemetry fields. The PR adds dialect to the success and catch paths but does not update these early returns. Low severity since these are configuration errors rather than SQL analysis failures, but inconsistent with the PR's intent.

Analysis run | Powered by QA Autopilot

@dev-punia-altimate
Copy link
Copy Markdown

Auto-fixed 4 finding(s)

  • FINDING-001
  • FINDING-002
  • FINDING-003
  • FINDING-004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardcoded dialect: "snowflake" across altimate-core tools

2 participants