-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redshift__type_string overwrite is causing all existing models to be marked as modified #469
Comments
Could you try without dispatch as well to see what you get? I know that |
I tried that:
I'm not sure why that is though. Maybe some redshift optimisation for nulls as TEXT such as:
This is supposedly VARCHAR(256): |
This might be slightly related to the other issue/PR dbt-labs/dbt-spark#467 on Redshift. Do you have
and copy the results here? My results look like
|
Here's the result with custom dispatch defined: {
"name": "type_string",
"resource_type": "macro",
"package_name": "dbt",
"path": "macros/utils/data_types.sql",
"original_file_path": "macros/utils/data_types.sql",
"unique_id": "macro.dbt.type_string",
"macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n",
"depends_on": {
"macros": [
"macro.dbt_project_evaluator.redshift__type_string"
]
},
"description": "",
"meta": {},
"docs": {
"show": true,
"node_color": null
},
"patch_path": null,
"arguments": [],
"created_at": 1719921400.9395182,
"supported_languages": null
}
{
"name": "default__type_string",
"resource_type": "macro",
"package_name": "dbt",
"path": "macros/utils/data_types.sql",
"original_file_path": "macros/utils/data_types.sql",
"unique_id": "macro.dbt.default__type_string",
"macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}",
"depends_on": {
"macros": []
},
"description": "",
"meta": {},
"docs": {
"show": true,
"node_color": null
},
"patch_path": null,
"arguments": [],
"created_at": 1719921400.9397166,
"supported_languages": null
}
{
"name": "redshift__type_string",
"resource_type": "macro",
"package_name": "dbt_project_evaluator",
"path": "macros/cross_db_shim/redshift_shims.sql",
"original_file_path": "macros/cross_db_shim/redshift_shims.sql",
"unique_id": "macro.dbt_project_evaluator.redshift__type_string",
"macro_sql": "{%- macro redshift__type_string() -%}\n {{ \"VARCHAR(600)\" }}\n{%- endmacro %}",
"depends_on": {
"macros": []
},
"description": "",
"meta": {},
"docs": {
"show": true,
"node_color": null
},
"patch_path": null,
"arguments": [],
"created_at": 1719921401.334528,
"supported_languages": null
} Here's how it looks to me: Other issues you pointed out to seem to be similar indeed. The error thrown mentions |
I created PR #473 I tested that with my local instance on redshift and it worked but I'm not sure if there are any unintended consequences of this.
What do you think? |
I created second PR dbt-labs/dbt-spark#475 with the call to api.Column.string_type(600) and special handling for databricks and bigquery. |
@b-per please let me know when can I expect this to be evaluated by someone. My proposed solution changes how string field in defined for package internal models without affecting any existing models, which I think is the way to go. |
Describe the bug
I configured dbt_project_evaluator with dispatch required for redshift. My intention is to use it in a slim CI.
I have a job in DBT Cloud which defers to the production environment. After configuring dispatch all models are recognised as modified.
Steps to reproduce
Expected results
It should be implemented in a way that does not overwrite core macros for all existing models.
Actual results
After package configuration I expect no models to be marked as changed.
Screenshots and log output
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:DBT version
12:26:46 Running with dbt=1.6.16
12:26:47 Registered adapter: redshift=1.6.7
Additional context
https://github.com/dbt-labs/dbt-project-evaluator/blob/main/macros/cross_db_shim/redshift_shims.sql
Are you interested in contributing the fix?
I can contribute, however I'm not sure how to fix it at this point.
The text was updated successfully, but these errors were encountered: