Skip to content

Conversation

nnegrey
Copy link
Contributor

@nnegrey nnegrey commented Dec 9, 2019

No description provided.

@nnegrey nnegrey requested a review from davidcavazos December 9, 2019 20:55
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 9, 2019
@nnegrey nnegrey changed the title remove old files that are updated by the generic batch_predict sample remove old files and update region tags for samples Dec 9, 2019
@nnegrey nnegrey changed the title remove old files and update region tags for samples automl: remove old files and update region tags for samples Dec 10, 2019
package automl

// [START automl_get_dataset]
// [START automl_language_entity_extraction_get_dataset]
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure all of the imports are the same and all of the whitespace is correct here? For some samples, this can make sense, but it isn't immediately obvious during review that these regions are correct. Separate files are more up front work, but very clearly correct (and don't accidentally get messed up when there is a new import).

(Go will fail to compile if there is an extra import.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean technically all of the automl samples should all have been on the v1 library not the v1beta1

Copy link
Contributor

Choose a reason for hiding this comment

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

That was my mistake, fixing that in #1122

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I meant all of the imports. Not just the API import. The reason the standard is to use separate files (https://github.com/GoogleCloudPlatform/golang-samples/blob/master/CONTRIBUTING.md#one-file-per-sample) is so that we're 100% sure the sample will work when copied and pasted from cloud.google.com.

Copy link
Contributor

@tbpg tbpg Dec 16, 2019

Choose a reason for hiding this comment

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

It's also very easy to mess up start/end tags when going in and out of functions (looking at the rest of the PR). I'm not sure every region is correct, so I'd prefer separate files, if you don't mind. gofmt should pass for every region, too.

Sometimes this type of setup works, but Go is weird with import and formatting requirements, so we have to be careful. :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the go folks want to maintain a bunch of additional files, that is fine. The goal of this was to move us away from maintaining 1400 files to about 400 for AutoML snippets.

Copy link
Contributor

Choose a reason for hiding this comment

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

Y'all will be maintaining the samples. So, if you prefer to do it this way, it seems correct from what I can tell. Let's go ahead with this as-is and we can change it later if needed. Sorry for the back and forth.

Copy link
Contributor

@davidcavazos davidcavazos left a comment

Choose a reason for hiding this comment

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

LGTM

package automl

// [START automl_get_dataset]
// [START automl_language_entity_extraction_get_dataset]
Copy link
Contributor

Choose a reason for hiding this comment

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

Y'all will be maintaining the samples. So, if you prefer to do it this way, it seems correct from what I can tell. Let's go ahead with this as-is and we can change it later if needed. Sorry for the back and forth.

Copy link
Contributor

@tbpg tbpg left a comment

Choose a reason for hiding this comment

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

Would you mind fixing the merge conflicts with master?

Copy link
Contributor

@tbpg tbpg left a comment

Choose a reason for hiding this comment

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

I ran gofmt, but the PR is failing to compile: https://source.cloud.google.com/results/invocations/ff0442c0-569c-4121-9af2-c287a0eb53d1/targets/cloud-devrel%2Fgo%2Fgolang-samples%2Fpresubmit%2Fgo113/log

vet: automl/model_evaluation_list.go:78:82: evaluation.GetTextSentimentAnalysisEvaluationMetrics undefined (type *v1.ModelEvaluation has no field or method GetTextSentimentAnalysisEvaluationMetrics)

@tbpg tbpg merged commit 002578a into master Dec 23, 2019
@tbpg tbpg deleted the automl-cleanup branch December 23, 2019 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants