Skip to content

Conversation

@callmehiphop
Copy link
Contributor

Related to #806

This makes Query objects mutable.

@callmehiphop callmehiphop added the api: datastore Issues related to the Datastore API. label Aug 17, 2015
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 17, 2015

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus
Copy link
Contributor

Do any of the tests test for this being returned?

This comment was marked as spam.

@stephenplusplus
Copy link
Contributor

👏

@callmehiphop
Copy link
Contributor Author

Do any of the tests test for this being returned?

They don't explicitly test that what is returned is the same as the original object e.g.

var query = new Query(['kind1']);
var limited = query.limit(10);

assert.strictEqual(query, limited);

However, there are tests that make use of the chaining - https://github.com/GoogleCloudPlatform/gcloud-node/blob/master/test/datastore/query.js#L345

@stephenplusplus
Copy link
Contributor

It's better to test for it explicitly, in case something random goes wrong with that catch all test. (maybe the last one in the chain doesn't return this, maybe not all of the methods were used, etc)

cloned query when creating nextQuery object

added unit tests for return values
@callmehiphop
Copy link
Contributor Author

Sure, tests have been created!

stephenplusplus added a commit that referenced this pull request Aug 18, 2015
datastore: make query objects mutable
@stephenplusplus stephenplusplus merged commit dc0eae7 into googleapis:master Aug 18, 2015
@callmehiphop callmehiphop deleted the mutable-query branch August 18, 2015 19:52
sofisl pushed a commit that referenced this pull request Nov 10, 2022
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 468735472

Source-Link: googleapis/googleapis@cfa1b37

Source-Link: googleapis/googleapis-gen@09b7666
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9
sofisl pushed a commit that referenced this pull request Jan 24, 2023
chore: relocate owl bot post processor
sofisl pushed a commit that referenced this pull request Jan 25, 2023
chore: relocate owl bot post processor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants