René's URL Explorer Experiment


Title: Smooth out API surfaces before M1 · Issue #336 · googleapis/google-cloud-python · GitHub

Open Graph Title: Smooth out API surfaces before M1 · Issue #336 · googleapis/google-cloud-python

X Title: Smooth out API surfaces before M1 · Issue #336 · googleapis/google-cloud-python

Description: Current offenders: There is no way to allocate_ids without explicitly using protobufs. I have partially addressed (Implemented in #436). Transactions don't give any indication of success or failure (i.e. commit or rollback in __exit__). ...

Open Graph Description: Current offenders: There is no way to allocate_ids without explicitly using protobufs. I have partially addressed (Implemented in #436). Transactions don't give any indication of success or failure...

X Description: Current offenders: There is no way to allocate_ids without explicitly using protobufs. I have partially addressed (Implemented in #436). Transactions don't give any indication of success or fai...

Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/336

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Smooth out API surfaces before M1","articleBody":"Current offenders:\n1. ~~There is no way to [`allocate_ids`](https://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/regression/datastore.py#L30) without explicitly using protobufs. I have partially [addressed](https://github.com/dhermes/gcloud-python/commit/0860e5902541eeb6146a3fb0f55ec66465b3dc39)~~ (Implemented in #436).\n2. ~~Transactions don't give any indication of success or failure (i.e. commit or rollback in [`__exit__`](https://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/gcloud/datastore/transaction.py#L252)).~~ (Filed #496)\n3. ~~`Query` (and other classes) could be more Pythonic by allowing us to pass values to constructor that also have their own setters. For [example](https://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/regression/datastore.py#L165):~~\n   \n   ``` python\n   query = dataset.query('Character').ancestor(\n       ANCESTOR_KEY).limit(10).order('appearances')\n   ```\n   \n   ~~becomes~~\n   \n   ``` python\n   query = dataset.query('Character', ancestor=ANCESTOR_KEY,\n                         limit=10, order='appearances')\n   ```\n   \n   ~~We don't have to go as extreme as #188 by wiping away the `return self` behavior in the setters, but could use them in conjuction with more Pythonic constructors.~~ (Implemented in #487)\n4. ~~`Query.cursor()` should not raise an error before being used. Using `query.cursor() is None` gives a way to check progress in a query. For example, in paging:~~ (addressed in #432)\n   \n   ``` python\n   query = dataset.query(kind=kind).limit(FETCH_MAX)\n   results = []\n   more_results = True\n   while more_results:\n       # Make new query.\n       if query._cursor is not None:\n           query = query.with_cursor(query._cursor)\n   \n       curr_results = query.fetch()\n       results.extend(curr_results)\n   \n       more_results = len(curr_results) == FETCH_MAX\n   ```\n5. ~~`Query` should give access to `start_cursor` and `end_cursor`. It is currently [only set](https://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/gcloud/datastore/query.py#L385) on the `pb`.~~ (see #432)\n6. Comparing `Entity` values should be easier. Current [workaround](https://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/regression/datastore.py#L243) is\n   \n   ``` python\n   arya_dict = dict(arya_entity.items())\n   self.assertEqual(arya_dict, {'name': 'Arya', 'family': 'Stark'})\n   ```\n7. ~~Paging [with offsets](https://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/regression/datastore.py#L287) should be a bit more automatic, as it is in `gcloud-node`. Currently we have to~~\n   \n   ``` python\n   query = query.offset(offset).limit(limit)\n   entities = page_query.fetch()\n   # Offset needs to be reset to 0 since we want to start exactly at `cursor`.\n   next_query = query.with_cursor(cursor).offset(0)\n   ```\n   \n   (done in #487, since `offset` always defaults to `0`)\n8. ~~I'm sure there will be plenty more to come after #319~~\n9. ~~(UPDATED): Consider making bulk-adding properties to `Entity` more intuitive. See #389.~~ (`dict.update()` is Pythonic and simple to use / multi-type signature)\n10. ~~(UPDATED): \"Creating a new datastore.entity with a key name is a pain.\" See #82~~\n","author":{"url":"https://github.com/dhermes","@type":"Person","name":"dhermes"},"datePublished":"2014-11-04T07:23:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":21},"url":"https://github.com/336/google-cloud-python/issues/336"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a7b3bae9-96cc-b7ed-2339-7ac6af9b9a9b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE5D0:3C2C53:328D00:441ABF:6A4D8D98
html-safe-nonce8ab011af0f249b3811109615ad7c67f1e07827d4f216e9634e0e32f5bef4e541
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUQwOjNDMkM1MzozMjhEMDA6NDQxQUJGOjZBNEQ4RDk4IiwidmlzaXRvcl9pZCI6Ijk1ODk0MzY2MzU2MzMxMjUzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc43ff055cb4a2b7debd5bc925e89d0b3552c35c01ed29367b103445f46892aae
hovercard-subject-tagissue:47684962
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/336/issue_layout
twitter:imagehttps://opengraph.githubassets.com/363be64068df6c937fcefd47cd0e9cdfab783c8e5ec742a4ba81ed1b6d2ffa04/googleapis/google-cloud-python/issues/336
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/363be64068df6c937fcefd47cd0e9cdfab783c8e5ec742a4ba81ed1b6d2ffa04/googleapis/google-cloud-python/issues/336
og:image:altCurrent offenders: There is no way to allocate_ids without explicitly using protobufs. I have partially addressed (Implemented in #436). Transactions don't give any indication of success or failure...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedhermes
hostnamegithub.com
expected-hostnamegithub.com
None06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33
turbo-cache-controlno-preview
go-importgithub.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id16316451
octolytics-dimension-repository_nwogoogleapis/google-cloud-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id16316451
octolytics-dimension-repository_network_root_nwogoogleapis/google-cloud-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release74e2a9c78f1e38588de4f25885878349d721eedf
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/google-cloud-python/issues/336#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fgoogle-cloud-python%2Fissues%2F336
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fgoogle-cloud-python%2Fissues%2F336
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fgoogle-cloud-python
Reloadhttps://github.com/googleapis/google-cloud-python/issues/336
Reloadhttps://github.com/googleapis/google-cloud-python/issues/336
Reloadhttps://github.com/googleapis/google-cloud-python/issues/336
Please reload this pagehttps://github.com/googleapis/google-cloud-python/issues/336
googleapis https://github.com/googleapis
google-cloud-pythonhttps://github.com/googleapis/google-cloud-python
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fgoogle-cloud-python
Fork 1.7k https://github.com/login?return_to=%2Fgoogleapis%2Fgoogle-cloud-python
Star 5.3k https://github.com/login?return_to=%2Fgoogleapis%2Fgoogle-cloud-python
Code https://github.com/googleapis/google-cloud-python
Issues 439 https://github.com/googleapis/google-cloud-python/issues
Pull requests 129 https://github.com/googleapis/google-cloud-python/pulls
Discussions https://github.com/googleapis/google-cloud-python/discussions
Actions https://github.com/googleapis/google-cloud-python/actions
Projects https://github.com/googleapis/google-cloud-python/projects
Security and quality 0 https://github.com/googleapis/google-cloud-python/security
Insights https://github.com/googleapis/google-cloud-python/pulse
Code https://github.com/googleapis/google-cloud-python
Issues https://github.com/googleapis/google-cloud-python/issues
Pull requests https://github.com/googleapis/google-cloud-python/pulls
Discussions https://github.com/googleapis/google-cloud-python/discussions
Actions https://github.com/googleapis/google-cloud-python/actions
Projects https://github.com/googleapis/google-cloud-python/projects
Security and quality https://github.com/googleapis/google-cloud-python/security
Insights https://github.com/googleapis/google-cloud-python/pulse
Smooth out API surfaces before M1https://github.com/googleapis/google-cloud-python/issues/336#top
https://github.com/dhermes
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
https://github.com/dhermes
dhermeshttps://github.com/dhermes
on Nov 4, 2014https://github.com/googleapis/google-cloud-python/issues/336#issue-47684962
allocate_idshttps://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/regression/datastore.py#L30
addressedhttps://github.com/dhermes/gcloud-python/commit/0860e5902541eeb6146a3fb0f55ec66465b3dc39
Adding a non-protobuf allocate_ids method on Dataset. #436https://github.com/googleapis/google-cloud-python/pull/436
__exit__https://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/gcloud/datastore/transaction.py#L252
DISCUSSION: Is there a way for a Transaction to indicate success/failure from __exit__ #496https://github.com/googleapis/google-cloud-python/issues/496
examplehttps://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/regression/datastore.py#L165
DISCUSSION: Are setter methods which clone and return object type confusing to end-users? #188https://github.com/googleapis/google-cloud-python/issues/188
Fix #439: split query vs. iterator apart. #487https://github.com/googleapis/google-cloud-python/pull/487
Removing cursor and more results from query object. #432https://github.com/googleapis/google-cloud-python/pull/432
only sethttps://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/gcloud/datastore/query.py#L385
Removing cursor and more results from query object. #432https://github.com/googleapis/google-cloud-python/pull/432
workaroundhttps://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/regression/datastore.py#L243
with offsetshttps://github.com/GoogleCloudPlatform/gcloud-python/blob/2b73c7b4b1bd2f0abd6bc7f3da6a48c135d8f53a/regression/datastore.py#L287
Fix #439: split query vs. iterator apart. #487https://github.com/googleapis/google-cloud-python/pull/487
Implementing storage regression tests to match gcloud-node. #319https://github.com/googleapis/google-cloud-python/pull/319
update() override for datastore entities #389https://github.com/googleapis/google-cloud-python/issues/389
Creating a new datastore.entity with a key name is a pain #82https://github.com/googleapis/google-cloud-python/issues/82
dhermeshttps://github.com/dhermes
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/google-cloud-python/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.