-
Notifications
You must be signed in to change notification settings - Fork 583
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
Warn if cog.yaml
or predictor are missing
#1470
Conversation
Signed-off-by: asingh9530 <[email protected]>
Thanks for the PR. It's a little confusing that this warning describes two possible issues. What do you think about handling the two exceptions with different warnings? Some untested pseudocode: except ConfigDoesNotExist:
warnings.warn("no cog.yaml found")
except PredictorNotSet:
warnings.warn("no predict() method found in Predictor") |
@zeke yeah I think that is much better let me make those changes. |
Signed-off-by: asingh9530 <[email protected]>
So... this will print a warning, but it will also blow up because the Is that that the intended behavior here, or do we want to print a warning without failing? |
I think even in previous setting it would blow but without any warning or error but in this case it will show warning to user and then blow. So the user will likely know the root cause.
if we want to prevent the build to even begin then we have to raise exception instead of warning something like this.
what do you think ? |
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.
This looks good to me 👍🏼
Signed-off-by: asingh9530 <[email protected]>
Signed-off-by: asingh9530 <[email protected]>
@zeke could please check why Integration failed as this PR dosen't contain any changes to the file reflected in tests. |
@asingh9530 the test 'https://github.com/replicate/cog/blob/main/test-integration/test_integration/test_build.py#L9' fails because it tests for a specific error message, which has been changed in this PR. Please update the test to match the new error message. |
Signed-off-by: Mattt <[email protected]>
cog.yaml
or predictor are missing
Thanks for your help with this, @asingh9530! |
Thanks for picking this up @mattt! 🙏🏼 |
What issue this PR fix - #1452