-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix mutateInstance() imlementations in inference module #137138
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 mutateInstance() imlementations in inference module #137138
Conversation
|
Pinging @elastic/ml-core (Team:ML) |
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.
Cool stuff! A couple of comments. Mostly on cleaning up those randomXorNull by reusing existing and adding new ones in ESTestCase. I didn't comment on all the places where that is relevant.
...ce/src/test/java/org/elasticsearch/xpack/inference/common/amazon/AwsSecretSettingsTests.java
Outdated
Show resolved
Hide resolved
...nference/services/azureaistudio/completion/AzureAiStudioChatCompletionTaskSettingsTests.java
Outdated
Show resolved
Hide resolved
...ack/inference/services/azureopenai/completion/AzureOpenAiCompletionServiceSettingsTests.java
Outdated
Show resolved
Hide resolved
| return randomValueOtherThan(instance, AzureOpenAiSecretSettingsTests::createRandom); | ||
| SecureString apiKey = instance.apiKey(); | ||
| SecureString entraId = instance.entraId(); | ||
| if (apiKey == null || entraId == null) { |
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.
As there is a constructor that accepts the args without doing validation, do we need the complicated logic here?
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.
I'm not seeing a constructor for AzureOpenAiSecretSettings that doesn't do the validation that both arguments aren't null. I could add one, but it doesn't seem like it's worth it just to make one test method slightly simpler.
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.
You're right, my eyes ignored Objects.requireNonNullElse(apiKey, entraId);
.../org/elasticsearch/xpack/inference/services/cohere/rerank/CohereRerankTaskSettingsTests.java
Outdated
Show resolved
Hide resolved
...ference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsServiceSettingsTests.java
Outdated
Show resolved
Hide resolved
.../inference/services/googlevertexai/embeddings/GoogleVertexAiEmbeddingsTaskSettingsTests.java
Outdated
Show resolved
Hide resolved
...csearch/xpack/inference/services/openai/embeddings/OpenAiEmbeddingsServiceSettingsTests.java
Outdated
Show resolved
Hide resolved
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.
LGTM
Closes #134166