From reading the Sentry docs (https://docs.sentry.io/platforms/python/enriching-events/context/) and the source code for set_context(key: str, value: Any), we tried the following in our codebase:
with push_scope() as scope:
scope.set_context('source_key', 'foo') # 'source_key' is a term in our application
Unfortunately, this led to an error in the UI with the reason "expected an object".

I may be misunderstanding something, but it seems that set_context should be annotated with value: Dict, and the docs updated accordingly. Is this correct?