-
Notifications
You must be signed in to change notification settings - Fork 913
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
Update error message when catalog entry is invalid #3944
Conversation
Signed-off-by: Ankita Katiyar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one question. + don't forget to add this to the release notes ✍️
@@ -288,6 +288,12 @@ class to be loaded is specified with the key ``type`` and their | |||
user_default = {} | |||
|
|||
for ds_name, ds_config in catalog.items(): | |||
if not isinstance(ds_config, dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #3555 there was a bit of discussion on what to do with values that are dict type, but not meant as dataset. Is it worth updating the message for that case as well to mention interpolation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I've added a hint to the error that comes from AbstractDataset.from_config()
as well!
Signed-off-by: Ankita Katiyar <[email protected]>
Signed-off-by: Ankita Katiyar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @ankatiyar ! The PR looks great. I have one question: Is it okay that we receive a different error if we put just some_value
into the catalog without a :
after it?
Some offline discussion with @DimedS on this. If there is a catalog entry which is just one word like this- some_value This is wrong YAML syntax and it'll error out much earlier when
This is not Kedro specific, it simply is just not allowed in YAML afaik. So to me, they seem like two different issues. This PR is to address when a catalog entry is correct syntactically in YAML but "wrong" as per Kedro rules (eg. not a valid dataset) in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. It seems it will be complicated to handle this properly on the Kedro side. Additionally, the error is meaningful as it points to the specific line number in catalog.yml
where the parsing issue occurs, unlike the other error mentioned in the ticket.
* Update error message when catalog entry is invalid Signed-off-by: Ankita Katiyar <[email protected]> * Update error message for dict type as well Signed-off-by: Ankita Katiyar <[email protected]> * Move error message Signed-off-by: Ankita Katiyar <[email protected]> --------- Signed-off-by: Ankita Katiyar <[email protected]> Signed-off-by: bpmeek <[email protected]>
* Update error message when catalog entry is invalid Signed-off-by: Ankita Katiyar <[email protected]> * Update error message for dict type as well Signed-off-by: Ankita Katiyar <[email protected]> * Move error message Signed-off-by: Ankita Katiyar <[email protected]> --------- Signed-off-by: Ankita Katiyar <[email protected]> Signed-off-by: bpmeek <[email protected]>
* Update error message when catalog entry is invalid Signed-off-by: Ankita Katiyar <[email protected]> * Update error message for dict type as well Signed-off-by: Ankita Katiyar <[email protected]> * Move error message Signed-off-by: Ankita Katiyar <[email protected]> --------- Signed-off-by: Ankita Katiyar <[email protected]> Signed-off-by: bpmeek <[email protected]>
Description
Fix #3910
Development notes
Add an error message if the catalog entry is not a dictionary - eg
Also, when the catalog entry is a dict but
type:
is missing.Developer Certificate of Origin
We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a
Signed-off-by
line in the commit message. See our wiki for guidance.If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.
Checklist
RELEASE.md
file