MCPcopy
hub / github.com/slackapi/python-slack-sdk / _remove_none_values

Function _remove_none_values

slack_sdk/web/internal_utils.py:325–333  ·  view source on GitHub ↗
(d: dict)

Source from the content-addressed store, hash-verified

323
324
325def _remove_none_values(d: dict) -> dict:
326 # To avoid having null values in JSON (Slack API does not work with null in many situations)
327 #
328 # >>> import json
329 # >>> d = {"a": None, "b":123}
330 # >>> json.dumps(d)
331 # '{"a": null, "b": 123}'
332 #
333 return {k: v for k, v in d.items() if v is not None}
334
335
336def _to_v2_file_upload_item(upload_file: Dict[str, Any]) -> Dict[str, Optional[Any]]:

Callers 15

channels_archiveMethod · 0.85
channels_createMethod · 0.85
channels_inviteMethod · 0.85
channels_joinMethod · 0.85
channels_kickMethod · 0.85
channels_leaveMethod · 0.85
channels_markMethod · 0.85
channels_renameMethod · 0.85
channels_setPurposeMethod · 0.85
channels_setTopicMethod · 0.85
channels_unarchiveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected