GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add support for namespaces · Issue #1 · googleapis/google-cloud-python

Add support for namespaces #1

New issue
Copy link
New issue
Copy link
Closed
Closed
Add support for namespaces#1
Copy link
Assignees
tseaver
Labels
api: datastoreIssues related to the Datastore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@jgeewax
jgeewax
opened on Jan 29, 2014
Issue body actions

These exist to an extent but aren't universal and certainly not well documented.

There are two options:

  1. Create an object to manage namespaces
from gcloud import datastore
dataset = datastore.get_dataset(...)
namespace = dataset.namespace('my-namespace')
person = namespace.entity('Person')
person['name'] = 'JJ'
person.save()

query = namespace.query('Person')
print query.fetch()
  1. Allow users to pass a namespace argument to various constructors (and set namespaces with a method, akin to setting a kind or id on a Key).
from gcloud import datastore
dataset = datastore.get_dataset(...)
person = dataset.entity('Person')
person.namespace('my-namespace')
person['name'] = 'JJ'
person.save()

query = dataset.query('Person').namespace('my-namespace')
print query.fetch()

or

person = namespace.entity('Person')
person['name'] = 'JJ'
person.save(namespace='my-namespace')

I currently prefer option 2, where a namespace isn't a separate level in the hierarchy, but simply a flag passed around on queries or entities.

Activity

Next
  1. proppy commented on Jan 29, 2014

    @proppy
    proppy
    on Jan 29, 2014
    Contributor
    More actions

    I think in 2) examples you meant person = dataset.entity('Person') not person = namespace.entity('Person')

  2. jgeewax commented on Jan 29, 2014

    @jgeewax
    jgeewax
    on Jan 29, 2014
    ContributorAuthor
    More actions

    Updated.

  3. tseaver commented on Oct 17, 2014

    @tseaver
    tseaver
    on Oct 17, 2014
    Contributor
    More actions

    I believe we address all the cases in the protobuf spec:

    • Keys carry a '_namespace' attribute.
    • 'Connection.run_query' accepts a 'namespace' argument.
    • PR Fix #170: handle namespaces in queries #255 adds namespace support to queries.

    Please re-open if we've missed a case.

  4. tseaver
    closed this as completedon Oct 17, 2014
  5. jgeewax
    modified the milestone: This milestone has been deleted on Jan 30, 2015
  6. urshala
    added 3 commits that reference this issue on Jan 17, 2020

    Merge pull request googleapis#1 from PhoenixAlx/master

    17c08a3

    Merge pull request googleapis#1 from janscas/master

    895d795

    Merge pull request googleapis#1 from O365/master

    8f0d99a
  7. JustinBeckwith
    assigned
    tseaver
    on Feb 1, 2021
  8. vchudnov-g
    added a commit that references this issue on Apr 19, 2023

    chore: release 0.1.0 (#1)

    9d9e2d9
  9. parthea
    added 2 commits that reference this issue on Apr 20, 2023

    chore: Migrate code from googleapis/python-ids into packages/google-c…

    90d8f68

    chore: release 0.1.0 (#1)

    432e52f
  10. vchudnov-g
    added 2 commits that reference this issue on May 8, 2023

    chore: release 0.1.0 (#1)

    ccf5c55

    chore: release 0.1.0 (#1)

    9760331
  11. 104 remaining items

  12. parthea
    added 4 commits that reference this issue on Nov 24, 2025

    chore: add split repo templates (#1)

    ddfbe49

    chore: add split repo templates (#1)

    f845c0c

    Merge pull request #1 from googleapis/repo-templates

    5bdc5f4

    fix: validate urls for external accounts (#1031)

    44d34c8
  13. parthea
    added a commit that references this issue on Dec 17, 2025

    Revert "chore: temporarily block generation to facilitate gradual rol…

    a7176d4
  14. parthea
    added 9 commits that reference this issue on Mar 2, 2026

    chore: add split repo templates (#1)

    66bdb5b

    complete setup.py (#1)

    91b9d1a

    Merge pull request #1 from dhermes/sans-io-for-download

    eb70432

    dbapi: use sentinel type TimestampStr type to indicate Spanner.TIMESTAMP

    385162d

    test: prepare the package for SQLAlchemy dialect compliance testing (#1)

    7bfbd60

    Merge pull request #1 from googleapis/repo-templates

    30d3e03

    Merge pull request #1 from googleapis/repo-templates

    1e1b1cb

    feat: add support for Point In Time Recovery (PITR) (#148)

    d424356

    Merge pull request #1 from googleapis/basic_files

    c0e05cb
  15. ohmayr
    added a commit that references this issue on Mar 31, 2026

    complete setup.py (#1)

    6f3230b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: datastoreIssues related to the Datastore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.