-
Notifications
You must be signed in to change notification settings - Fork 906
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
Make all paths relative in kedro catalog resolve
#3641
Conversation
Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
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.
Awesome work with the tests! 🌟
kedro/framework/cli/catalog.py
Outdated
"""Trim the filepaths in the config dictionary, make them relative to the project path.""" | ||
conf_keys_with_path = ["filepath", "path", "filename"] | ||
for key, value in config.items(): | ||
if isinstance(value, 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.
Nice recursive case!
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.
Actually I have the question, do we want to show absolute path or relative path? Resolving to an absolute path doesn't seem wrong to me. Is this consistent to kedro catalog list
?
From my understanding, we are basically trying to undo this line of code.
kedro/kedro/framework/context/context.py
Line 99 in 941440a
conf_dictionary[conf_key] = _convert_paths_to_absolute_posix( |
Would it be easier to actually create the DataCatalog maunally without going context.catalog
instead of creating a recursive call to undo this?
Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
@noklam you're right, I've updated it! |
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.
Tested and it works well! 👍
Description
This bug was my bad! 😅
I'd suggested in #3561 to just remove the trimming of filepaths because we were only checking for
filepath
key in the catalog config butPartitionedDataset
uses the keypath
which was causing an error.But the filepaths in
context.catalog._dataset_patterns
are absolute paths (because of thiskedro/kedro/framework/context/context.py
Line 54 in e8f1bfd
kedro catalog resolve
, the output for factory datasets had absolute paths but explicit datasets were all relative pathsEg -
kedro catalog resolve
Development notes
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