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 — Filters should support properties with leading/trailing whitespaces in the name. · Issue #424 · googleapis/google-cloud-python

Filters should support properties with leading/trailing whitespaces in the name. #424

New issue
Copy link
New issue
Copy link
Closed
#430
Closed
Filters should support properties with leading/trailing whitespaces in the name.#424
#430
Copy link
Assignees
dhermes
Labels
🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.

Description

@silvolu
silvolu
opened on Dec 17, 2014
Issue body actions

.filter('property with space =', 1) or .filter(' property with leading and trailing spaces =', 1) should result in the properties names not losing the trailing/leading whitespaces.
More context in #294 (comment)

Activity

Next
  1. silvolu
    added
    api: datastoreIssues related to the Datastore API.
    fix-asap
    on Dec 17, 2014
  2. dhermes commented on Dec 17, 2014

    @dhermes
    dhermes
    on Dec 17, 2014
    Contributor
    More actions

    I'm happy to support this but it seems like allowing developers to define properties with any spaces is asking for undefined or unexpected behavior. Adding leading and trailing spaces even more so.

    ISTM there are two separate points / sides to take:

    • Just because the API supports it doesn't mean it's a best-practice. An idiomatic library should encourage best-practices.
    • This implementation in gcloud-python is intended to be very low-level and map the API exactly. Only power users will need it and higher level ORMs such as ndb built on top of gcloud-python are intended for typical users.

    In my mind, the 2nd point is the more valid one, but we are not at all being clear about this in our development. In addition we are spending time making gcloud.datastore and it's modules idiomatic as if non-power users would be interacting with it.

    I strongly prefer a future that involves running ndb on top of gcloud-python, but would like to have some sort of plan in place.

    Luckily, if we do decide to implement this @Alfus comments in #294 carve out a good chunk of what needs to be done.

  3. Alfus commented on Dec 17, 2014

    @Alfus
    Alfus
    on Dec 17, 2014
    More actions

    I is possible to have it both ways with two different versions of the
    filter function. One precise one:
    filter(" name ", "op", "value") # the field name is taken as is
    and one concise one:
    filter("name op", "value") # the field name + op is parsed in a restricted
    way

    but there really should be a way to specify a filter on any supported
    property name.

    On Tue Dec 16 2014 at 8:13:10 PM Danny Hermes [email protected]
    wrote:

    I'm happy to support this but it seems like allowing developers to define
    properties with any spaces is asking for undefined or unexpected
    behavior. Adding leading and trailing spaces even more so.

    ISTM there are two separate points / sides to take:

    • Just because the API supports it doesn't mean it's a best-practice.
      An idiomatic library should encourage best-practices.
    • This implementation in gcloud-python is intended to be very
      low-level and map the API exactly. Only power users will need it and higher
      level ORMs such as ndb built on top of gcloud-python are intended for
      typical users.

    In my mind, the 2nd point is the more valid one, but we are not at all
    being clear about this in our development. In addition we are spending time
    making gcloud.datastore and it's modules idiomatic as if non-power users
    would be interacting with it.

    I strongly prefer a future that involves running ndb on top of
    gcloud-python, but would like to have some sort of plan in place.

    Luckily, if we do decide to implement this @Alfus
    https://github.com/Alfus comments in #294
    #294 carve out
    a good chunk of what needs to be done.

    Reply to this email directly or view it on GitHub
    #424 (comment)
    .

  4. tseaver commented on Dec 17, 2014

    @tseaver
    tseaver
    on Dec 17, 2014
    Contributor
    More actions

    I really don't understand the use case for the two-argument form:

    derived = base.filter('prop name =', 'value)
    

    versus the more natural / idomatic three-argument spelling:

    derived = base.filter('prop name', '=', 'value)
    

    As a bonus, the three-argument form makes the problem with leading / trailing (even embedded) spaces go away.

  5. silvolu commented on Dec 17, 2014

    @silvolu
    silvolu
    on Dec 17, 2014
    ContributorAuthor
    More actions

    I'm for the three-argument form as well. @jgeewax? #294 (comment)

  6. dhermes
    self-assigned this
    on Dec 17, 2014
  7. dhermes commented on Dec 17, 2014

    @dhermes
    dhermes
    on Dec 17, 2014
    Contributor
    More actions

    FYI to all. I am working on this right now and changing the signature to

    def filter(self, property_name, operation, value):

    so that now

    filtered_query = query.filter('age', '>', 50)
    

    will be the way to call filter.

    This makes it much simpler to support property names with any arbitrary kind of whitespace and also is a true mapping to the underlying proto (I mentioned this before). In light of my comment above, being a truer mapping is a good thing.

    Please chime in if there are any issues or concerns.

  8. dhermes
    added 4 commits that reference this issue on Dec 17, 2014

    Changing Query.filter to ask for operator and prop. name separately.

    This issue will close once commit a883fb3 is merged into the 'master' branch.
    a883fb3

    Changing Query.filter to ask for operator and prop. name separately.

    This issue will close once commit 2f0bc4f is merged into the 'master' branch.
    2f0bc4f

    Changing Query.filter to ask for operator and prop. name separately.

    This issue will close once commit 0850558 is merged into the 'master' branch.
    0850558

    Changing Query.filter to ask for operator and prop. name separately.

    This issue will close once commit d3c3d78 is merged into the 'master' branch.
    d3c3d78
  9. dhermes
    closed this as completedin #430on Dec 17, 2014
  10. jgeewax
    modified the milestone: This milestone has been deleted on Jan 30, 2015
  11. 19 remaining items

  12. parthea
    added a commit that references this issue on Oct 22, 2023

    chore(deps): update actions/setup-python action to v4 [autoapprove] (#…

    9c55838
  13. parthea
    added a commit that references this issue on Aug 21, 2025

    fix: Deprecate format specific `row_count` field in Read API (#424)

    749c06f
  14. parthea
    added 2 commits that reference this issue on Sep 16, 2025

    fix: Deprecate format specific `row_count` field in Read API (#424)

    3d9a09e

    test: remove redundant NIGHTLY run from CircleCI (#446)

    9dbc6ff
  15. parthea
    added 6 commits that reference this issue on Nov 22, 2025

    chore: blacken samples noxfile template (#424)

    9c265f0

    chore(deps): update dependency protobuf to v3.12.2 (#424)

    5d4ed2b

    chore: remove 'pip install' statements from python_library templates …

    9943504

    chore(deps): update all dependencies (#424)

    d16d357

    chore(deps): update dependency pytest to v7.2.2 (#424)

    ccebe3d

    feat: distinguish transport and execution time timeouts (#424)

    40bf758
  16. parthea
    added 2 commits that reference this issue on Mar 2, 2026

    docs: block until the streaming pull shuts down (#424)

    c2cbf91

    chore(python): update dependencies in /.kokoro (#424)

    ff01cde
  17. parthea
    added 3 commits that reference this issue on Mar 9, 2026

    chore(deps): update dependency urllib3 to v1.26.20 (#424)

    14d5bc1

    chore: add SECURITY.md (#424)

    ac5920c

    chore(deps): update actions/setup-python action to v6 (#424)

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

Metadata

Metadata

Assignees

  • @dhermes
    dhermes

Labels

🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.

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.