Skip to content

model['config'] can be null#499

Open
mattiamatrix wants to merge 3 commits into
starburstdata:masterfrom
mattiamatrix:fix-comments
Open

model['config'] can be null#499
mattiamatrix wants to merge 3 commits into
starburstdata:masterfrom
mattiamatrix:fix-comments

Conversation

@mattiamatrix
Copy link
Copy Markdown

@mattiamatrix mattiamatrix commented Aug 28, 2025

Overview

This is required to fix an issue detected in elementary-data/elementary#1886.
Calling trino__create_table_as and then calling comment causes a crash because model does not have a "config" key.

model['config'] is used in other areas of the code; it should probably be updated to make it more robust!

Fixes error

{"data": {"exc": "Compilation Error\n 'dict object' has no attribute 'config'\n \n > in macro trino__create_table_as (macros/adapters.sql)\n ...

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • README.md updated and added information about my change
  • I have run changie new to create a changelog entry

{%- endmacro -%}

{% macro comment(comment) %}
{%- set persist_docs = model['config'].get('persist_docs') -%}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don't mind the implementation, but that's the idea. model['config'] can return null.

The code should be updated to make it safer.

@mattiamatrix mattiamatrix changed the title fix-comments model['config'] can be null Aug 28, 2025
@mattiamatrix
Copy link
Copy Markdown
Author

@damian3031 can you please take a look at this?

@mattiamatrix
Copy link
Copy Markdown
Author

@damian3031 please?

@mattiamatrix
Copy link
Copy Markdown
Author

any update?

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.

1 participant