Skip to content
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

Changing Key noun to be Blob in storage package. #560

Merged
merged 1 commit into from
Jan 27, 2015

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Jan 20, 2015

This involves changes in all documentation, renaming a module
and a test module, and updating the calls and variable names in
a regression test module.

Addresses #544.

See https://github.com/dhermes/gcloud-python/tree/fix-544-many-commits for a more digestible version of these commits (though it's still not very digestible).

To "check" I was finished I manually inspected the output of "git grep -i key".

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 20, 2015
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling b5ceb5f on dhermes:fix-544 into 1bfa469 on GoogleCloudPlatform:master.

@dhermes
Copy link
Contributor Author

dhermes commented Jan 20, 2015

@tseaver I'm not certain that object_ is the right name for the module, maybe gcs_object instead? Same applies to variable names. I'm also unsure if Object should be the class name or something else. I'm somewhat worried people will naively do things like:

>>> from gcloud.storage.object_ import Object
>>> object = Object('foo')
>>> 
>>> class MyClass(object):
...     pass
... 
>>> MyClass
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "gcloud/storage/object_.py", line 110, in __repr__
    bucket_name = self.bucket.name
AttributeError: 'str' object has no attribute 'name'
>>> m = MyClass()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'Object' object is not callable

and not understanding why they break.

@dhermes dhermes added the api: storage Issues related to the Cloud Storage API. label Jan 22, 2015
@dhermes
Copy link
Contributor Author

dhermes commented Jan 23, 2015

@tseaver @jgeewax This is what we discussed earlier today.

It's going to be a bear to manage this PR while also changing other parts of the storage API, so I'd prefer to get the noun remapping out of the way soon.

Ideas put forth today (in order of my preference, best to last):

  • blob.Blob -- mirrors a concept similar / familiar to users
  • gcs_object.GCSObject -- still probably too close to object
  • file.File -- conflicts with (mostly defunct) builtin. File seems an imprecise mapping to an object.
  • object_.Object -- hits too close to home with Python (uber-important object builtin), but matches the actual noun in the API

The current language (removed in this PR) is:

The fundamental container for a file in Cloud Storage is called an Object,
however gcloud uses the term Key to avoid confusion between
object and Object.

For me, this language is not prevalent enough and I worry that straying away from "object" (even for Blob) will cause frustration with users trying to Google search for API concepts.

@jgeewax
Copy link
Contributor

jgeewax commented Jan 23, 2015

Your list above is my exact order of preference.

What might be worthwhile is to figure out how to make the Sphinx documentation generate the left-hand navigation from "Storage --> Keys" to "Storage --> Blobs (Objects)".

This way, when I'm looking for familiar terms from the docs, I still see what I was looking for, but get the picture right away.

I think the note you have above should be a .. warning: (or something bright colored) so it's obvious what is going on.

@dhermes
Copy link
Contributor Author

dhermes commented Jan 24, 2015

@jgeewax I was more worried about when they search in the API docs, not the docs for our library. The API docs will be more definitive / comprehensive than our library docs.

Do we think anyone from storage has gone through this existential naming issue with Object and object conflicting in Python? /cc @thobrla

@thobrla
Copy link

thobrla commented Jan 26, 2015

apitools autogenerates Object as part of its messages file, because that is the resource name. What makes it usable in practice is that the module name is not "object". That way, it's not that confusing in practice because you're typically referencing it via "messages.Object" or the like.

With that said, apitools maps 1:1 to the API, which I don't believe is the goal here. gcloud-python will have its own docs, yes? Are clients intended to interact with the API directly in the same codebase where they are using gcloud-python? If not, matching the API docs is reduced in importance.

@dhermes
Copy link
Contributor Author

dhermes commented Jan 26, 2015

Yes we have our own docs. Your input "matching the API docs is reduced in importance" is good to know; I wasn't sure how worried we should be about a vocab gap.

I am going to go thrown and use blob.Blob. Let me know if this is an issue.

@dhermes dhermes changed the title Changing Key noun to be Object in storage package. Changing Key noun to be Blob in storage package. Jan 26, 2015
This involves changes in all documentation, renaming a module
and a test module, and updating the calls and variable names in
a regression test module.

Fixes googleapis#544.
@dhermes
Copy link
Contributor Author

dhermes commented Jan 26, 2015

@tseaver I just updated from object -> blob. PTAL.

If you want an ad hoc set of smaller commits, check out
https://github.com/dhermes/gcloud-python/tree/fix-544-blob-many-commits

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 4570c43 on dhermes:fix-544 into * on GoogleCloudPlatform:master*.

@tseaver
Copy link
Contributor

tseaver commented Jan 27, 2015

Reviewing now.

@tseaver
Copy link
Contributor

tseaver commented Jan 27, 2015

LGTM. Since Travis doesn't check it for PRs, I also verified that the regression tests pass.

@dhermes
Copy link
Contributor Author

dhermes commented Jan 27, 2015

Thanks. I also run the regression tests locally before sending PRs.

dhermes added a commit that referenced this pull request Jan 27, 2015
Changing Key noun to be Blob in storage package.
@dhermes dhermes merged commit 3e89521 into googleapis:master Jan 27, 2015
@dhermes dhermes deleted the fix-544 branch January 27, 2015 18:22
vchudnov-g pushed a commit that referenced this pull request Sep 20, 2023
…[autoapprove] (#560)

Source-Link: googleapis/synthtool@4826337
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:60a63eddf86c87395b4bb394fdddfe30f84a7726ee8fe0b758ea132c2106ac75

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Sep 22, 2023
…obs, yarn_application_ids) in DiagnoseClusterRequest (#560)

* feat: add optional parameters (tarball_gcs_dir, diagnosis_interval, jobs, yarn_application_ids) in DiagnoseClusterRequest

PiperOrigin-RevId: 565501215

Source-Link: googleapis/googleapis@6b95655

Source-Link: googleapis/googleapis-gen@caf4b28
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2FmNGIyOGY3NTIyZWYyMWJjYzAwNmJjYjhjOWI2Y2Q2ZDIyMzFjNCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Oct 21, 2023
* feat: Add client library support for AssetService v1 AnalyzeOrgPolicies API
feat: Add client library support for AssetService v1 AnalyzeOrgPolicyGovernedContainers API
feat: Add client library support for AssetService v1 AnalyzeOrgPolicyGovernedAssets API

PiperOrigin-RevId: 520696122

Source-Link: googleapis/googleapis@fb446a2

Source-Link: googleapis/googleapis-gen@f4b9936
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjRiOTkzNjQwM2ZhZjg0NzE4MGEzNTM2MzZiZTUxNWQyMWQ1Y2FjNCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Oct 21, 2023
* docs: Minor formatting
chore: Update gapic-generator-python to v1.11.5
build: Update rules_python to 0.24.0

PiperOrigin-RevId: 563436317

Source-Link: googleapis/googleapis@42fd37b

Source-Link: googleapis/googleapis-gen@280264c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjgwMjY0Y2EwMmZiOTMxNmI0MjM3YTk2ZDBhZjFhMjM0M2E4MWE1NiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: Added support for retriggering notifications in AlertPolicy
feat: Added support for forecast options in AlertPolicy
feat: Added support for promQL condition type in AlertPolicy

PiperOrigin-RevId: 564411592

Source-Link: googleapis/googleapis@babab51

Source-Link: googleapis/googleapis-gen@b282e01
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI4MmUwMTJkYjBmMDAzNmJmZjIyMzAwZDNmYzEwMWQyNThiYWNhNyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
@release-please release-please bot mentioned this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants