You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My first reaction was that we should not change the datastore example as it is different from the big query example in that the create (the then part of the if~else) also populate the content.
However, this is also true for storage as both parts of the if~else also set the content.
Indeed, the datastore example makes more sense to me as the "else" part
is showing a way to update an entity that already exists by splitting name into
first and last name (as oppose to a complete override of the content as we do for storage)
but maybe that is too much to show for such example (not to mention that typically
this should be done transactionally which would even further complicate the example).
I do think we should modify the big query example, as suggested earlier, to remove the else
so that in the same request we create the table if needed and upload data to it.
Honestly, I think for storage best would be to split the example into 2 separate example
snippets. One for get and display (meta data and content) and one for create.
We could probably do the same for datastore or maybe add some comments to the existing
example and even big query can add a snippet for reading data.
Also, while at it, should resource manager example modified as well? replace just after create is not a typical usage pattern.
I agree with the idea to split "create" and "update" actions in the snippets for storage, datastore, and resource manager.
This is probably slightly more convenient for users as well. If they run a snippet with create/update combined and creation works, but adding/updating data errors, a user can't simply run the same snippet over again. They'll have to modify their code because they can't create the same exact resource again.
I agree with both @ajkannan and @aozarov, i.e., splitting storage and data store into snippets, and modifying big query to create-if-needed-and-load meaning. All of them make sense. Same for resource manager---short snippets would be my preferred way.
I agree that we should split create and update, even though I wouldn't expect users to simply copy-paste snippets but rather use them to write their own first simple program.
I will take care of fixing the snippet situation as soon as #614 is merged in. I'll also try to fix #607.
Activity
ajkannan commentedon Feb 4, 2016
I agree that the datastore "else" makes a more sense because users typically won't create an entity and right away modify it.
aozarov commentedon Feb 4, 2016
My first reaction was that we should not change the datastore example as it is different from the big query example in that the create (the
thenpart of the if~else) also populate the content.However, this is also true for storage as both parts of the if~else also set the content.
Indeed, the datastore example makes more sense to me as the "else" part
is showing a way to update an entity that already exists by splitting name into
first and last name (as oppose to a complete override of the content as we do for storage)
but maybe that is too much to show for such example (not to mention that typically
this should be done transactionally which would even further complicate the example).
I do think we should modify the big query example, as suggested earlier, to remove the else
so that in the same request we create the table if needed and upload data to it.
Honestly, I think for storage best would be to split the example into 2 separate example
snippets. One for get and display (meta data and content) and one for create.
We could probably do the same for datastore or maybe add some comments to the existing
example and even big query can add a snippet for reading data.
Also, while at it, should resource manager example modified as well? replace just after create is not a typical usage pattern.
Thoughts?
ajkannan commentedon Feb 4, 2016
I agree with the idea to split "create" and "update" actions in the snippets for storage, datastore, and resource manager.
This is probably slightly more convenient for users as well. If they run a snippet with create/update combined and creation works, but adding/updating data errors, a user can't simply run the same snippet over again. They'll have to modify their code because they can't create the same exact resource again.
mderka commentedon Feb 4, 2016
I agree with both @ajkannan and @aozarov, i.e., splitting storage and data store into snippets, and modifying big query to create-if-needed-and-load meaning. All of them make sense. Same for resource manager---short snippets would be my preferred way.
mziccard commentedon Feb 5, 2016
I agree that we should split create and update, even though I wouldn't expect users to simply copy-paste snippets but rather use them to write their own first simple program.
I will take care of fixing the snippet situation as soon as #614 is merged in. I'll also try to fix #607.
aozarov commentedon Feb 10, 2016
Fixed by #635
chore: release 1.1.1-SNAPSHOT (googleapis#618)
chore(deps): update dependency com.google.cloud:google-cloud-monitori…
chore: update github actions (#1361) (#618)
chore: release 3.0.2-SNAPSHOT (#618)
Enable staleness and pull request size bots on repository (#618)
build(deps): update dependency com.google.cloud:google-cloud-shared-c…
chore: add GCS_BUCKET env var (#622)
chore: release 3.0.2-SNAPSHOT (googleapis#618)
chore: add GCS_BUCKET env var (#622)
chore: release 2.4.5-SNAPSHOT (googleapis#618)