Skip to content

fix: include schema temp table#5545

Merged
eakmanrq merged 1 commit intomainfrom
eakmanrq/include_schema_temp_table
Oct 15, 2025
Merged

fix: include schema temp table#5545
eakmanrq merged 1 commit intomainfrom
eakmanrq/include_schema_temp_table

Conversation

@eakmanrq
Copy link
Collaborator

@eakmanrq eakmanrq commented Oct 15, 2025

BQ requires a schema defined when creating the temp table and we want to ensure it gets created in the same place as the target physical schema.

https://tobiko-data.slack.com/archives/C044BRE5W4S/p1760530731990029

@eakmanrq eakmanrq requested a review from Copilot October 15, 2025 20:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a BigQuery requirement where temporary tables need to be created with an explicit schema defined, ensuring they are created in the same location as the target physical schema.

  • Updates temporary table creation in _get_target_and_source_columns to include the model's physical schema
  • Adds comprehensive test coverage to verify the temp table creation includes the correct schema

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
sqlmesh/core/snapshot/evaluator.py Modified temp table creation to include physical schema for BQ compatibility
tests/core/test_snapshot_evaluator.py Added test to verify temp table creation with schema when using IGNORE change policies

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@eakmanrq eakmanrq merged commit 2bff831 into main Oct 15, 2025
36 checks passed
@eakmanrq eakmanrq deleted the eakmanrq/include_schema_temp_table branch October 15, 2025 23:13
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