Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Support boolean type for key, endkey, and startkey in view requests #504

Merged
merged 11 commits into from
Jun 21, 2021

Conversation

mojito317
Copy link
Contributor

@mojito317 mojito317 commented Jun 14, 2021

Checklist

  • Tick to sign-off your agreement to the Developer Certificate of Origin (DCO) 1.1
  • Added tests for code changes or test/build only changes
  • Updated the change log file (CHANGES.md) or test/build only changes
  • Completed the PR template below:

Description

Fixes #494

Approach

Allow bool type for endkey, key, and startkey.

Schema & API Changes

  • No change

Security and Privacy

  • No change

Testing

Edited the invalid tests to use {'foo': 'bar'} invalid values instead of booleans, and extended the existing tests to validate boolean types.

Monitoring and Logging

  • No change

@mojito317 mojito317 changed the title 492 view with a boolean type key View with a boolean type key Jun 15, 2021
@mojito317 mojito317 changed the title View with a boolean type key Fix View with a boolean type key Jun 15, 2021
@mojito317 mojito317 marked this pull request as ready for review June 15, 2021 13:25
Copy link
Contributor

@emlaver emlaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a couple of invalid tests that should be removed since boolean type is valid. For example: https://github.com/cloudant/python-cloudant/blob/master/tests/unit/param_translation_tests.py#L298
and
https://github.com/cloudant/python-cloudant/blob/master/tests/unit/param_translation_tests.py#L243

We'll also want to modify existing tests to validate boolean types.

CHANGES.md Outdated
@@ -5,6 +5,7 @@
- [FIXED] Fixed result paging for grouped view queries.
- [FIXED] Incorrect use of username as account name in `Cloudant.bluemix()`.
- [IMPROVED] Documented use of None account name and url override for `Cloudant.iam()`.
- [FIXED] View with a boolean type key.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:

[FIXED] Support boolean type for key(s) in view requests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used:

[FIXED] Support boolean type for key, endkey, and startkey in view requests.

@mojito317 mojito317 force-pushed the 492-view-with-a-boolean-type-key branch from 3988cae to d395a1a Compare June 16, 2021 07:53
@mojito317
Copy link
Contributor Author

mojito317 commented Jun 16, 2021

There's a couple of invalid tests that should be removed since boolean type is valid. For example: https://github.com/cloudant/python-cloudant/blob/master/tests/unit/param_translation_tests.py#L298
and
https://github.com/cloudant/python-cloudant/blob/master/tests/unit/param_translation_tests.py#L243

We'll also want to modify existing tests to validate boolean types.

I fixed the tests in e876a39 then I realized there is a need for a modification in the code to pass the tests: d89eba6.

@mojito317 mojito317 requested review from emlaver and ricellis June 16, 2021 08:30
@mojito317 mojito317 changed the title Fix View with a boolean type key Support boolean type for key, endkey, and startkey in view requests Jun 16, 2021
@mojito317 mojito317 changed the title Support boolean type for key, endkey, and startkey in view requests Support boolean type for key, endkey, and startkey in view requests Jun 16, 2021
@mojito317 mojito317 force-pushed the 492-view-with-a-boolean-type-key branch from 49962d1 to 86ffcb7 Compare June 16, 2021 14:07
@mojito317
Copy link
Contributor Author

As @ricellis and I agreed offline I put back the invalid tests with {'foo': 'bar'} values that have to be invalid in e76f903.

CHANGES.md Outdated Show resolved Hide resolved
Co-authored-by: Rich Ellis <ricellis@users.noreply.github.com>
@mojito317 mojito317 self-assigned this Jun 18, 2021
@mojito317
Copy link
Contributor Author

Thank you for the review @emlaver and @ricellis! I'm merging this!

@mojito317 mojito317 merged commit 19b14ab into master Jun 21, 2021
@mojito317 mojito317 deleted the 492-view-with-a-boolean-type-key branch June 21, 2021 07:48
@ricellis ricellis added this to the 2.next milestone Jun 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Querying a view with a boolean type key raises a CloudantArgumentError
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.