Skip to content

SQLMesh UI doesn't use dialect when displaying the model column data type #4822

Open
@codykonior

Description

@codykonior

When running sqlmesh ui and accessing a model like http://127.0.0.1:8000/data-catalog/models/some_model_name it's giving column types like VARCHAR and hiding all of the underlying type data like that it's actually NVARCHAR(MAX). This is because it's using str(data_type) instead of using the model dialect via data_type.sql(dialect=model.dialect).

You can fix this in web\server\api\endpoints\models.py by changing:

        columns.append(models.Column(name=name, type=str(data_type), description=description))

To:

        columns.append(models.Column(name=name, type=data_type.sql(dialect=model.dialect), description=description))

Which works on my machine. This isn't critical because I will switch to using Python instead of the API but it might be nice for others!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions