Skip to content

Fix: set columns attribute for python models that generate sql#3087

Merged
izeigerman merged 3 commits intoSQLMesh:mainfrom
opensource-observer:ravenac95/fix-python-sql-model-columns
Sep 4, 2024
Merged

Fix: set columns attribute for python models that generate sql#3087
izeigerman merged 3 commits intoSQLMesh:mainfrom
opensource-observer:ravenac95/fix-python-sql-model-columns

Conversation

@ravenac95
Copy link
Contributor

We encountered this while making a python model that had is_sql=True. We send some generative things to our clickhouse instance and because we use the clickhouse dialect this seems to cause some issues when attempting to transpile to other dialects like duckdb due to the Nullable type appearing as a derived type for a specific column of the final result. So to solve this we decided to just explicitly set the columns in the python sql model. However we encountered a bug in doing this.

@CLAassistant
Copy link

CLAassistant commented Sep 4, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for fixing this!

@georgesittas georgesittas changed the title Fix python sql explicit column declaration Fix: set columns attribute for python models that generate sql Sep 4, 2024
@izeigerman izeigerman merged commit 48105dd into SQLMesh:main Sep 4, 2024
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.

4 participants