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-737] [Bug] Wonky pluralization when duplicate docs are found #5352

Closed
1 task done
pdebelak opened this issue Jun 9, 2022 · 1 comment · Fixed by #5356
Closed
1 task done

[CT-737] [Bug] Wonky pluralization when duplicate docs are found #5352

pdebelak opened this issue Jun 9, 2022 · 1 comment · Fixed by #5356
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!

Comments

@pdebelak
Copy link
Contributor

pdebelak commented Jun 9, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The error message for duplicate docs is:

dbt found two docss with the name "whatever".

Expected Behavior

The error message would be:

dbt found two docs with the name "whatever".

Steps To Reproduce

  1. Create multiple {% docs whatever %} blocks with the same name.
  2. Run dbt parse.
  3. See the weird pluralization in the output.

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:

What database are you using dbt with?

redshift

Additional Context

I believe the pluralize method of NodeType.Documentation would need to be updated to change this.

@pdebelak pdebelak added bug Something isn't working triage labels Jun 9, 2022
@github-actions github-actions bot changed the title [Bug] Wonky pluralization when duplicate docs are found [CT-737] [Bug] Wonky pluralization when duplicate docs are found Jun 9, 2022
@jtcohen6 jtcohen6 added good_first_issue Straightforward + self-contained changes, good for new contributors! Team:Language and removed triage labels Jun 9, 2022
@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 9, 2022

@pdebelak Nice catch!

I believe the pluralize method of NodeType.Documentation would need to be updated to change this.

You're spot on :) Would you like to contribute the fix for this?

def pluralize(self) -> str:
if self == "analysis":
return "analyses"
else:
return f"{self}s"

Is the plural of docs, docs? Should it be docs blocks (per our docs)? I could go either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants