-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
0.15.0+ versions not showing errors with duplicate doc names #2054
Comments
Thanks for the report @braydenconnole! This is definitely a regression. I took a quick look at the commit you sent over, but I'm not certain that that's the relevant part of the codebase here. Instead, check out how dbt parsed docs in 0.14.x: And how dbt parses docs in 0.15.x: Note that the I think the fix is pretty straightforward here:
Let me know if this is something you'd be interested in contributing a fix for -- we're super happy to help out however we can! Last, I'm cc'ing @beckjake here in case I'm missing something important - I think I recall discussing this change with him recently, but I'm hazy on the details. |
@drewbanin good find! I could contribute a fix for it. I'll take a look at your contributor documentation and let you know when I have any questions on it. |
@drewbanin After reading your CLA. I'm switching to my personal account instead. You should see more things coming from this account instead. |
Thanks for the update @bubbomb - that works for me! |
@drewbanin I put up a PR that fixes the issue, but I'm having trouble figuring out where to put the test, as well as how to set up the docstrings appropriately so the test can work. Any help would be awesome on this front Thanks! |
fix docstring duplication error issue #2054
Describe the bug
It looks like version 0.15.0 removed a feature that throws an error when there are duplicate doc names.
Steps To Reproduce
In a doc block define two docs variables with the same name like so:
Make a .yml file that references
'{{doc("person_id")}}'
run
dbt docs generate
ordbt run
using version 0.14.4 of dbt. (also works on some lower versions I've only checked 0.14.3 and 0.14.4)and you'll get this error:
If you upgrade dbt to 0.15.0 or 0.15.1, This error never occurs and dbt compiles the docs.
Expected behavior
I would expect the newer version to also throw the error when there are duplicates in the doc block names
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using: Mac OS Catalina
The output of
python --version
: Python 3.7.3I did a little digging to see if I could find where the change occurred between the two versions and I did find that the
raise_duplicate_resource_name
function in thecore/dbt/exceptions.py
file was changed in this commit:e54661b5df3b3126eb94c16f9784b6ad438b0232
To include this if block:
Maybe the code is hitting the
return
in this case so the error is never thrown? I haven't been able to dig much further than this so far.I didn't see a ton of changes to other functions that called
raise_duplicate_resource_name
between the0.14.4
and0.15.0
versions, so I'm guessing that it probably starts here.The text was updated successfully, but these errors were encountered: