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

Remove unneeded filepath check on dataset factories #3561

Merged
merged 7 commits into from
Feb 2, 2024

Conversation

MosaicMan
Copy link
Contributor

Signed off by MosaicMan 34198823+MosaicMan@users.noreply.github.com

Description

Addressing bug as described in #3560. Ran test suite as well as linter. Test status unchanged.

Development notes

Tweaked the path normalization logic in the resolve_patterns method of the framework.cli.catalog module

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

  • Read the contributing guidelines
  • Signed off each commit with a Developer Certificate of Origin (DCO)
  • [N/A] Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • [N/A] Updated the documentation to reflect the code changes
  • [N/A] Added a description of this change in the RELEASE.md file
  • [N/A] Added tests to cover my changes
  • [N/A] Checked if this change will affect Kedro-Viz, and if so, communicated that with the Viz team

@MosaicMan MosaicMan force-pushed the cli_catalog_resolve_patterns branch 5 times, most recently from d7a4d15 to 1de3086 Compare January 27, 2024 13:11
Signed-off-by: MosaicMan <34198823+MosaicMan@users.noreply.github.com>
Comment on lines 268 to 275
path_keys_to_check = ["filepath", "path"]

for key in path_keys_to_check:
if key in ds_config:
ds_config[key] = _trim_filepath(
str(context.project_path) + "/", ds_config[key]
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AhdraMeraliQB @merelcht Could we get rid of this whole check instead of hard-coding this?
I see this was a design decision (#2891 (comment))
I think this was before the code went through a few changes. Even for explicit datasets, we just get the config as it is written in the catalog using the config loader so relative path instead of the absolute path so everything is uniform even without this check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me - tried removing this check locally and it all the tests still pass.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point @ankatiyar. If everything still works as expected and the problem with PartitionedDataset is solved when the check is removed, then that definitely seems like the best solution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in that case, @MosaicMan could you get rid of these lines entirely and the _trim_filepath() method below? And add this change to the release notes as well! :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. No problem.

MosaicMan and others added 3 commits January 31, 2024 18:39
- Remove filepath check from `resolve_patterns` method.
- Eliminate the associated `_trim_filepath` function.
- Update release notes.

These changes address redundant validations that were causing kedro-org#3560.

Signed-off-by: MosaicMan <34198823+MosaicMan@users.noreply.github.com>
Signed-off-by: Ankita Katiyar <110245118+ankatiyar@users.noreply.github.com>
Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
Copy link
Contributor

@ankatiyar ankatiyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @MosaicMan for this PR! 💯

Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @MosaicMan

@ankatiyar ankatiyar enabled auto-merge (squash) February 1, 2024 15:45
@ankatiyar ankatiyar merged commit a0abbd1 into kedro-org:main Feb 2, 2024
33 checks passed
@astrojuanlu astrojuanlu changed the title Adding a list of "path" keys to check dataset config against. Remove unneeded filepath check on dataset factories Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants