Skip to content

--Empty flag only useful in the simplest projects #595

@Benjamin-Knight

Description

@Benjamin-Knight

Right now the SQL server adapter is inheriting the behaviour of the _render_limited_alias from the DBT core adapter

https://github.com/dbt-labs/dbt-adapters/blob/48c110f547b4e6eea294a179cb562fef5bd29ba4/dbt-adapters/src/dbt/adapters/base/relation.py#L60

This means that all refs get an alias output when running with the empty flag. This is fine if you use no aliases at all in your project, it would seem to me that only the simplest of projects could get away with this requirement. Is anyone actually able to do this successfully?

I would suggest that we change the require_alias flag to false for SQL server and make the provision of aliases down to the project owner. This means that a project that has a requirement for an alias anywhere in their codebase can use the --Empty flag by ensuring aliases are used consistently throughout the project.

Ideally this would be a configurable flag that can be set by the user of the adapter I cannot see how you pass project level flags into BaseRelation and derived classes. If someone knows of a way to do that then I can add a pull request that adds this custom flag and uses that instead.

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