Skip to content
This repository was archived by the owner on Sep 9, 2023. It is now read-only.

Conversation

sai-chaithu
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #945 ☕️

@sai-chaithu sai-chaithu requested review from a team as code owners June 28, 2022 09:18
@generated-files-bot
Copy link

generated-files-bot bot commented Jun 28, 2022

Warning: This pull request is touching the following templated files:

  • samples/install-without-bom/pom.xml
  • samples/snapshot/pom.xml
  • samples/snippets/pom.xml

@snippet-bot
Copy link

snippet-bot bot commented Jun 28, 2022

Here is the summary of changes.

You are about to add 5 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: vertex-ai Issues related to the googleapis/java-aiplatform API. samples Issues that are directly related to samples. labels Jun 28, 2022
@diemtvu diemtvu added the kokoro:run Add this label to force Kokoro to re-run the tests. label Jun 29, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Jun 29, 2022
@junkourata junkourata self-requested a review July 8, 2022 01:09
@junkourata junkourata requested a review from dizcology July 8, 2022 01:12
@junkourata junkourata added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 8, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 8, 2022
.setParent(EntityTypeName.of(project, location, featurestoreId, entityTypeId).toString())
.addAllRequests(createFeatureRequests).build();

OperationFuture<BatchCreateFeaturesResponse, BatchCreateFeaturesOperationMetadata> future =
Copy link

Choose a reason for hiding this comment

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

Name the operationFutures consistently across the files, maybe use batchCreateFeaturesOperationFuture or just future, but use same across.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, will use same across

List<CreateFeatureRequest> createFeatureRequests = new ArrayList<>();

Feature titleFeature = Feature.newBuilder().setDescription("The title of the movie")
.setValueType(ValueType.valueOf("STRING")).build();
Copy link

Choose a reason for hiding this comment

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

Use the ENUM directly here and in other places as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will update to ENUM type everywhere as below,

Suggested change
.setValueType(ValueType.valueOf("STRING")).build();
.setValueType(ValueType.STRING).build();

Copy link

Choose a reason for hiding this comment

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

Thanks!


Feature titleFeature = Feature.newBuilder().setDescription("The title of the movie")
.setValueType(ValueType.valueOf("STRING")).build();
Feature genresFeature = Feature.newBuilder().setDescription("The genres of the movie")
Copy link

Choose a reason for hiding this comment

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

nit: change to singular genre, to me genres represents an array of genres.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using the same features as https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/feature_store/gapic-feature-store.ipynb sample tutorial provided in SOW.
So thought it is ok, should we change it here?

Copy link

Choose a reason for hiding this comment

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

Oh I see, let's retain it for now. It was a minor nit.

System.out.format("Operation name: %s%n", future.getInitialFuture().get().getName());
System.out.println("Waiting for operation to finish...");
BatchCreateFeaturesResponse batchCreateFeaturesResponse =
future.get(timeout, TimeUnit.SECONDS);
Copy link

Choose a reason for hiding this comment

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

just to confirm, is the behavior here to wait the 300 sec and timeout otherwise. If there is a response available, it's returned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, if the response is not received in 300 sec it will throw timeout

.setCsvReadInstances(CsvSource.newBuilder().setGcsSource(gcsSource))
.setDestination(
FeatureValueDestination.newBuilder().setBigqueryDestination(bigQueryDestination))
// .addAllPassThroughFields(passThroughFieldsList)
Copy link

Choose a reason for hiding this comment

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

should we include this as well, if possible ?

Copy link
Contributor Author

@sai-chaithu sai-chaithu Jul 8, 2022

Choose a reason for hiding this comment

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

removing that as there are no passThroughFields for the movie prediction example.

List<String> ids = new ArrayList<>();
ids.add("*");
FeatureSelector featureSelector = FeatureSelector.newBuilder()
.setIdMatcher(IdMatcher.newBuilder().addAllIds(ids).build()).build();
Copy link

Choose a reason for hiding this comment

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

nit: inline something like addAllIds(ArrayList.of()...), or make a class variable if intended for developer to update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, will add inline as below,

Suggested change
.setIdMatcher(IdMatcher.newBuilder().addAllIds(ids).build()).build();
.setIdMatcher(IdMatcher.newBuilder().addAllIds(Arrays.asList("title","genres","average_rating")).build()).build();

Copy link

Choose a reason for hiding this comment

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

I feel it's better to make it one of the variables the developer has to update and pass it down here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated code to pass the feature selector ids as a list object

@junkourata junkourata added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 26, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 26, 2022
@junkourata junkourata added the kokoro:run Add this label to force Kokoro to re-run the tests. label Jul 29, 2022
Copy link
Contributor

@dizcology dizcology left a comment

Choose a reason for hiding this comment

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

Please make sure sample tests pass before merging.