[ISSUE] iam.Patch value is not send when False
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start at the iam.Patch class used by the AccountClient users.patch entry point and trace how its value is serialized into the REST request body. Reproduce the deactivation example with value=False and verify that the completed request includes the value field while still handling an unset value correctly.
Written by the indexing model from the issue text.
Description
Description
SCIM Patch class has defect when setting value to False. When value gets serialised back to REST API the value column is skipped from the body. This is because of if self.value: body['value'] = self.value logic in the Patch class.
Reproduction
Easy way to reproduce is to deactivate a User by setting active = False in Patch command
from databricks.sdk.service import iam
from databricks.sdk import AccountClient
ac = AccountClient(...)
ac.users.patch(
id = 123,
operations = [ iam.Patch(op=iam.PatchOp.ADD, path='active', value=False) ],
schemas=[ iam.PatchSchema.URN_IETF_PARAMS_SCIM_API_MESSAGES_2_0_PATCH_OP ]
)
this gets sent, notice lack of value field: body = {'Operations': {'op': 'add', 'path': 'active'}], 'schemas': ['urn:ietf:params:scim:api:messages:2.0:PatchOp'], 'id': 123}
Expected behavior
code should check if value is not None instead, so that falsy checks dont cause this behaviour
- Dominant language
- Python
- Stars
- 568
- Forks
- 217
- Avg merge
- 1h 1m
- Merged PRs (30d)
- 8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databricks/databricks-sdk-py
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
databricks/databricks-sdk-py#1496 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
databricks/databricks-sdk-py#1495 · 1 comment ·
-
[ISSUE] `get_api_error` fails with `TypeError: object of type '_io.BufferedReader' has no len()¨` Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
databricks/databricks-sdk-py#1489 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
databricks/databricks-sdk-py#1451 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
databricks/databricks-sdk-py#1264 · 1 reaction ·
All issues in databricks/databricks-sdk-py
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100