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

Better legacy failure warning #1570

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ProExpertProg
Copy link
Contributor

In case someone fails to create the V2 pipeline, I think it's helpful to print the error.

horheynm
horheynm previously approved these changes Jan 30, 2024
Comment on lines 143 to 144
_LOGGER.warning(f"Could not create v2 '{task}' pipeline, with error: {e}")
_LOGGER.warning(f"Attempting to create the legacy pipeline")
Copy link
Contributor

Choose a reason for hiding this comment

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

could we combine these to one string so only one message is logged?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I just figured the error might be long. But I'll put it at the end, something like:

_LOGGER.warning(f"Could not create v2 '{task}' pipeline, attempting to create the legacy pipeline. V2 pipeline error: {e}")

Copy link
Contributor

Choose a reason for hiding this comment

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

You can just do:

_LOGGER.warning(f"Could not create v2 '{task}' pipeline, with error: {e}. "
                                 "Attempting to create the legacy pipeline")

Copy link
Member

Choose a reason for hiding this comment

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

I think Luka meant the error will be long so the sentence might look weird in the console

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah just in case

rahul-tuli
rahul-tuli previously approved these changes Jan 30, 2024
dbogunowicz
dbogunowicz previously approved these changes Jan 30, 2024
Comment on lines 143 to 144
_LOGGER.warning(f"Could not create v2 '{task}' pipeline, with error: {e}")
_LOGGER.warning(f"Attempting to create the legacy pipeline")
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just do:

_LOGGER.warning(f"Could not create v2 '{task}' pipeline, with error: {e}. "
                                 "Attempting to create the legacy pipeline")

@rahul-tuli rahul-tuli dismissed their stale review January 30, 2024 19:05

Quality Check Pending

@dsikka
Copy link
Contributor

dsikka commented Jan 30, 2024

You can't have the word error in your warning

@ProExpertProg
Copy link
Contributor Author

Oh, I see. What words are allowed? Can I say "failed with"?

@dsikka
Copy link
Contributor

dsikka commented Jan 30, 2024

@ProExpertProg you're currently failing this test:

def test_pipeline_benchmark(

Which checks for error and fail

Single-line and removed `error` keyword
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.

6 participants