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

dbt_project.yaml allows additional properties in flags, which can overlook typos in flag names #179

Open
alexras opened this issue Dec 13, 2024 · 3 comments

Comments

@alexras
Copy link

alexras commented Dec 13, 2024

The latest schema for dbt_project.yaml doesn't have additionalProperties: false set for its top-level flags key. This means that if you make a typo on a flag name, your dbt_project.yaml will still pass JSON schema validation. Ask me how I know 😅

I'm happy to open a PR to fix this, but wanted to make sure that it's not intentional first, since additionalProperties: false is being used elsewhere in that schema.

@joellabes
Copy link
Collaborator

Ooof! What did you typo? In addition to fleshing out the list of accepted flags on the schema, I've also noted that we should capture typos in dbt_project.yml when we take on dbt-labs/dbt-core#8942

I think that there's some flags we don't have enumerated here yet (especially new behaviour change flags), so before disallowing additionalProperties those would also need to be synced up. But once they're in sync I'd have no issue with locking it down!

@alexras
Copy link
Author

alexras commented Dec 16, 2024

Ooof! What did you typo?

send_anonymous_usage_stats (we typo'd it as send_anonymous_usage_state 🤦🏻 )

I think that there's some flags we don't have enumerated here yet ...

Is it safe to assume that the complete list of flags is enumerated here?

@joellabes
Copy link
Collaborator

joellabes commented Dec 16, 2024

Is it safe to assume that the complete list of flags is enumerated here?

Adapters can have their own specific behaviour change flags too, documented here: https://docs.getdbt.com/reference/global-configs/adapter-behavior-changes

But otherwise yes!

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

2 participants