Skip to content
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

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

Open
Benjamin-Knight opened this issue Feb 4, 2025 · 1 comment
Open

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

Benjamin-Knight opened this issue Feb 4, 2025 · 1 comment

Comments

@Benjamin-Knight
Copy link
Contributor

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.

@Benjamin-Knight
Copy link
Contributor Author

Looks like other people are seeing the issue and our inability to control the behaviour right now.

dbt-labs/dbt-adapters#807

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

No branches or pull requests

1 participant