Skip to content

Commit

Permalink
Inspector should allow explicit None for delegate_map (pytorch#4136)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#4136

The SDK inspector should allow parsing delegates that have a `None`
for their delegate_map. This is explicitly None, and not unspecified, which
is why the default of an empty dict didn't work.

Use `or {}` to instead detect None.

Reviewed By: Olivia-liu

Differential Revision: D59298227

fbshipit-source-id: 8503d680acb4c393459ee2956bfd7b9f4725803c
  • Loading branch information
dulinriley authored and facebook-github-bot committed Jul 3, 2024
1 parent 28638d7 commit 970e278
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/inspector/_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ def _gen_resolve_debug_handles(

# For delegated events, handles are found via delegateMetadata
event.delegate_backend_name = delegate_metadata.get("name", "")
delegate_metadata_delegate_map = delegate_metadata.get("delegate_map", {})
delegate_metadata_delegate_map = delegate_metadata.get("delegate_map") or {}

# delegate_debug_id can be either int based or string based, therefore we need to check both
debug_handles = delegate_metadata_delegate_map.get(
Expand Down

0 comments on commit 970e278

Please sign in to comment.