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

fix(sdk): Fix "No KFP components found in file" error. Fixes #8353 #8359

Merged
merged 3 commits into from
Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions sdk/python/kfp/cli/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ def _load_components(self):
module_name=module_name, module_directory=module_directory)

python_file = str(python_file)
if not component_modules:
logging.error(
Copy link
Member

Choose a reason for hiding this comment

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

nit/question: I'm curious what this logging adds without the check.

I think the logging on line 175 is now redundant with the logging on line 179, since the execution will not sys.exit anymore. WDYT about either [simpler approach] removing the entire if not component_modules block or [more involved approach] changing the logging to something like the following:

comp_dir/file.py
comp_dir/other_file.py
comp_dir/component.py [component]

I'm not sure [component] is the best way of visually displaying this information, but just thinking out loud with this mock up.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! I'll opt for removing this if block.

f'No KFP components found in file {python_file}')
raise sys.exit(1)

logging.info(
f'Found {len(component_modules)} component(s) in file {python_file}:'
Expand Down