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

Linting rule to PREVENT select * in general #3753

Open
sungchun12 opened this issue Jan 30, 2025 · 0 comments
Open

Linting rule to PREVENT select * in general #3753

sungchun12 opened this issue Jan 30, 2025 · 0 comments
Assignees
Labels
Feature Adds new functionality

Comments

@sungchun12
Copy link
Contributor

sungchun12 commented Jan 30, 2025

I want the ability to add a linting rule that prevents the application of a plan if it detects any select * in my models whether it knows they can be expanded or not. This is more to solve for enforcing SQL best practice.

config.yaml/config.py: add a config here to the model_defaults.

If it detects a select * print the file path in the terminal output, so I can easily navigate and fix it.

This is helpful because I was scratching my head adding a column to a single model and wondering why a model upstream kept causing breaking changes downstream. It's because select * was downstream in my other models. I wasted precious time and money making SQLMesh backfill more stuff than it needed to for a silly mistake.

cc @VaggelisD given you worked on the most relevant PR recently.

@sungchun12 sungchun12 changed the title Dynamically replace select * with fully rendered column names if known Linting rule to PREVENT select * in general Jan 30, 2025
@georgesittas georgesittas added the Feature Adds new functionality label Feb 4, 2025
@VaggelisD VaggelisD self-assigned this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Adds new functionality
Projects
None yet
Development

No branches or pull requests

3 participants