Skip to content

CORE-877: Fix microbatch integration test for Fabric#1015

Merged
elazarlachkar merged 2 commits into
masterfrom
CORE-877-fix-microbatch-for-fabric
May 26, 2026
Merged

CORE-877: Fix microbatch integration test for Fabric#1015
elazarlachkar merged 2 commits into
masterfrom
CORE-877-fix-microbatch-for-fabric

Conversation

@elazarlachkar
Copy link
Copy Markdown
Contributor

@elazarlachkar elazarlachkar commented May 26, 2026

Summary

  • Use DbtProject.is_tsql when generating microbatch source model SQL in integration tests
  • Ensures Fabric uses datetime2 for event_time casts (same as SQL Server) instead of invalid timestamp

Test plan

  • Verify microbatch compiled code integration test passes on Fabric
  • Confirm existing SQL Server microbatch test behavior is unchanged

Made with Cursor

Summary by CodeRabbit

  • Tests
    • Updated microbatch SQL test to standardize timestamp casting in generated queries, ensuring consistent validation of event-time handling across platforms without changing test setup or configurations.

Review Change Stack

Use DbtProject.is_tsql to select datetime2 on T-SQL targets instead of checking sqlserver only.

Co-authored-by: Cursor <cursoragent@cursor.com>
@linear
Copy link
Copy Markdown

linear Bot commented May 26, 2026

CORE-877

@github-actions
Copy link
Copy Markdown
Contributor

👋 @elazarlachkar
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 the elementary repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7c755bbc-8be7-4e87-a275-ce4402474e9d

📥 Commits

Reviewing files that changed from the base of the PR and between 94251a0 and 25a7b06.

📒 Files selected for processing (1)
  • integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py

📝 Walkthrough

Walkthrough

The microbatch source-model SQL generator was changed to remove the adapter-specific Jinja computation of event_time_data_type and to cast order_date directly using {{ elementary.edr_type_timestamp() }} in both UNION ALL branches; config(event_time='order_date') remains.

Changes

Microbatch SQL change

Layer / File(s) Summary
Template: replace adapter Jinja with edr_type_timestamp()
integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py
Removed Jinja event_time_data_type derived from target.type and changed both order_date casts to use {{ elementary.edr_type_timestamp() }} directly within _microbatch_source_model_sql.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through templates, neat and quick,
Took out a branch, made casting slick,
Now order_date leaps true and bright,
With edr_type_timestamp in sight — ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly references the issue CORE-877 and specifies that it fixes the microbatch integration test for Fabric, which directly aligns with the PR's main objective of ensuring Fabric uses the correct timestamp type.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch CORE-877-fix-microbatch-for-fabric

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

Lets adapter dispatch pick the correct timestamp type for Fabric and other targets.

Co-authored-by: Cursor <cursoragent@cursor.com>
@elazarlachkar elazarlachkar merged commit 0276b15 into master May 26, 2026
29 of 30 checks passed
@elazarlachkar elazarlachkar deleted the CORE-877-fix-microbatch-for-fabric branch May 26, 2026 17:46
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.

2 participants