Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KV Store Collection API - dict Type Issue #356

Closed
malvidin opened this issue Nov 2, 2020 · 2 comments
Closed

KV Store Collection API - dict Type Issue #356

malvidin opened this issue Nov 2, 2020 · 2 comments

Comments

@malvidin
Copy link

malvidin commented Nov 2, 2020

Describe the bug
The **query in KV Store Data API functions have an error in typing or in usage in the function.

def query(self, **query):

return json.loads(self._get('', **query).body.read().decode('utf-8'))

To Reproduce
Use the KVStoreCollectionData query with the dict type prescribed in the docstrings
collection.data.query(query={"id": {"$gt": 24}}) or collection.data.query({"id": {"$gt": 24}})

Expected behavior
The previous queries should succeed, as documented.
https://docs.splunk.com/Documentation/Splunk/8.1.0/RESTREF/RESTkvstore

Splunk Version

  • Version: 8.1.0
  • OS: Docker Build 5c3f219bbb6b

splunklib Version

  • Version: 1.6.14
  • Language Runtime Version: Python 3.7
  • OS: Ubuntu 20.04
@malvidin malvidin changed the title Likely Misuse of **query in API KV Store Collection API - dict Type Issue Nov 2, 2020
akaila-splunk added a commit that referenced this issue Sep 22, 2021
Added dictionary support for KVStore "query" methods. Change with reference to issue #356   . KVStore example also updated
@akaila-splunk
Copy link
Contributor

Hi @malvidin , Thanks for bringing it up.
We have considered your suggestion and added dictionary support for KVStore "query" methods. Also updated the KVStore example file for reference. Changes will be available in the next release.

@ashah-splunk
Copy link
Contributor

Hi @malvidin , we have a new SDK release 1.6.17 with the proposed changes. Would request you to try with the latest SDK version. Let us know in case if you face any issue with the change implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants