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

[CT-3289] [Feature] Common misspellings of Configs Are Silently Ignored - they should raise warnings #8942

Open
3 tasks done
graciegoheen opened this issue Oct 30, 2023 · 5 comments
Labels
enhancement New feature or request paper_cut A small change that impacts lots of users in their day-to-day
Milestone

Comments

@graciegoheen
Copy link
Contributor

graciegoheen commented Oct 30, 2023

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Users can pass whatever custom configs they want. There have been issues because of this before...
#5605
#4280
#2606

where folks are trying to add a Real config, but have a small typo that causes it to go undetected:

  • known common mistakes like:
    • 'materialization' instead of 'materialized'
    • 'error' instead of 'error_if'
    • 'test' instead of 'tests'
  • typos of expected keys like 'materialied' instead of 'materialized'. There are fancy but easy to implement ways like "edit distance" to detect this.

(og thinking from @peterallenwebb and @jtcohen6)

Acceptance Criteria

  1. Post validation we should check configs for "possible misspellings"
  2. For identified "possible misspellings" a warning should be issued that looks like We detected a key "<misspelled_key>" did you mean "<correct_spelling>"
  3. The warning type should be silence-able

Details

We should throw a warning anytime you supply a config that we don't actually use. (see original conversation about this)

If I have a config that dbt doesn't use:

models:
  - name: some_model
    invalid_key:
      - something
    columns:
      - name: id
        my_personal_key:
          - something_else

We should emit a warning like "my_personal_key is not recognized as a dbt config within models/columns" - probs need to wordsmith that ;)

We should provide the ability to silence this warning if it is indeed intentional, ideally for that specific instance. Similar in spirit to:

We could suggest what they may have intended to type "did you mean materialized instead of materialied?" if we wanna get fancy with it.

@graciegoheen graciegoheen added enhancement New feature or request triage paper_cut A small change that impacts lots of users in their day-to-day and removed triage labels Oct 30, 2023
@github-actions github-actions bot changed the title [Feature] warnings for user-inputted configs that are very similar to Real ones [CT-3289] [Feature] warnings for user-inputted configs that are very similar to Real ones Oct 30, 2023
@graciegoheen
Copy link
Contributor Author

Instead, we could throw a warning anytime you supply a config that we don't actually use. (see original conversation about this)

If I have a config that dbt doesn't use:

models:
  - name: some_model
    invalid_key:
      - something
    columns:
      - name: id
        my_personal_key:
          - something_else

We should emit a warning like "my_personal_key is not recognized as a dbt config within models/columns" - probs need to wordsmith that ;)

We should provide the ability to silence this warning if it is indeed intentional, ideally for that specific instance. Similar in spirit to:

We could suggest what they may have intended to type "did you mean materialized instead of materialied?" if we wanna get fancy with it.

@graciegoheen graciegoheen changed the title [CT-3289] [Feature] warnings for user-inputted configs that are very similar to Real ones [CT-3289] [Feature] Incorrect Configs Are Silently Ignored - they should raise warnings Apr 25, 2024
@graciegoheen graciegoheen added this to the v1.9 milestone Apr 25, 2024
@joellabes
Copy link
Contributor

+1 to this from Jenna
image

@danielhorvath-cleo
Copy link

+1 from me as well.

I literally spent hours recently debugging why incrementalisation doesn't work properly on one model, only to find out I typed unqiue_key in the config.

In the meantime, what's the best practice to guard against such errors?

@graciegoheen graciegoheen changed the title [CT-3289] [Feature] Incorrect Configs Are Silently Ignored - they should raise warnings [CT-3289] [Feature] Common misspellings of Configs Are Silently Ignored - they should raise warnings Jun 10, 2024
@graciegoheen graciegoheen modified the milestones: v1.9, v1.10 Nov 25, 2024
@boxysean
Copy link
Contributor

Screenshot 2024-11-29 at 10 53 16 AM Screenshot 2024-11-29 at 10 53 22 AM Screenshot 2024-11-29 at 10 53 29 AM

@joellabes
Copy link
Contributor

dbt_project.yml isn't called out here, but it should be included too I think! cf dbt-labs/dbt-jsonschema#179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request paper_cut A small change that impacts lots of users in their day-to-day
Projects
None yet
Development

No branches or pull requests

4 participants