Skip to content

Fix: create_test error with query and CTEs included#5559

Merged
treysp merged 1 commit intomainfrom
trey/test-cte-date-err
Oct 22, 2025
Merged

Fix: create_test error with query and CTEs included#5559
treysp merged 1 commit intomainfrom
trey/test-cte-date-err

Conversation

@treysp
Copy link
Contributor

@treysp treysp commented Oct 22, 2025

closes #5550

@treysp treysp requested a review from Copilot October 22, 2025 18:38
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 an error in the create_test function when working with queries that include CTEs. The fix involves adding a default value to the pandas_timestamp_to_pydatetime function and updating how it's called to use explicit keyword arguments.

  • Added default value None to the columns_to_types parameter
  • Updated function call to use explicit keyword argument df= instead of positional argument

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
sqlmesh/utils/date.py Added default value None to columns_to_types parameter in pandas_timestamp_to_pydatetime function
sqlmesh/core/test/definition.py Updated function call to use keyword argument and removed the second positional argument

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

@treysp treysp merged commit a0668dc into main Oct 22, 2025
36 checks passed
@treysp treysp deleted the trey/test-cte-date-err branch October 22, 2025 19:53
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.

TypeError when using --include-ctes with DATE, DATETIME, or TIMESTAMP columns in sqlmesh create_test

3 participants