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

added cog.yaml warning #1470

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

Conversation

asingh9530
Copy link

What issue this PR fix - #1452

Signed-off-by: asingh9530 <abhinav199530singh@gmail.com>
@zeke
Copy link
Member

zeke commented Jan 5, 2024

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")

@asingh9530
Copy link
Author

@zeke yeah I think that is much better let me make those changes.

Signed-off-by: asingh9530 <abhinav199530singh@gmail.com>
@zeke
Copy link
Member

zeke commented Jan 5, 2024

So... this will print a warning, but it will also blow up because the pass was removed, right?

Is that that the intended behavior here, or do we want to print a warning without failing?

@asingh9530
Copy link
Author

So... this will print a warning, but it will also blow up because the pass was removed, right?

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.

Is that that the intended behavior here, or do we want to print a warning without failing?

if we want to prevent the build to even begin then we have to raise exception instead of warning something like this.

    except ConfigDoesNotExist:
        raise ConfigDoesNotExist("no cog.yaml found or present")
    except PredictorNotSet:
        raise PredictorNotSet("no predict method found in Predictor")

what do you think ?

Copy link
Member

@zeke zeke left a 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 👍🏼

@zeke zeke requested a review from a team January 9, 2024 00:49
@asingh9530
Copy link
Author

@zeke @aron can you please approve test workflows.

Signed-off-by: asingh9530 <abhinav199530singh@gmail.com>
Signed-off-by: asingh9530 <abhinav199530singh@gmail.com>
@asingh9530
Copy link
Author

@zeke could please check why Integration failed as this PR dosen't contain any changes to the file reflected in tests.

@yorickvP
Copy link
Contributor

yorickvP commented Feb 8, 2024

@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.

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.

None yet

4 participants