-
Notifications
You must be signed in to change notification settings - Fork 131
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
[OPIK-310] Expose get prompts api #547
Conversation
…github.com/comet-ml/opik into thiagohora/OPIK-309_exposing_api_contracts
…hora/OPIK-309_exposing_api_contracts
…hora/OPIK-309_exposing_api_contracts
…hora/OPIK-310_expose_get_prompts_api
8104d91
to
81dfab6
Compare
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.
Looks great, had a couple of comments
" ORDER BY id DESC " + | ||
" LIMIT :limit OFFSET :offset ") | ||
@UseStringTemplateEngine | ||
@AllowUnusedBindings |
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.
Do we need this?
" WHERE workspace_id = :workspace_Id " + | ||
" <if(name)> AND name like concat('%', :name, '%') <endif> ") | ||
@UseStringTemplateEngine | ||
@AllowUnusedBindings |
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.
Do we need this?
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.
Yeah, because of the string template. If the name is null, it will not render the where clause, and there will be no :name
argument.
apps/opik-backend/src/test/java/com/comet/opik/api/resources/v1/priv/PromptResourceTest.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Test | ||
@DisplayName("when search by name, then return prompt matching name") |
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.
It's worth adding a test for the case of a prompt exists and you search for it with a string that doesn't match the name to see that it is not returned
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.
Done
d439827
to
ec2175e
Compare
Details
Find prompts
Issues
OPIK-310