How to access app_id
and partition_key
inside an action?
#445
-
Dear burr developers Sorry if it's obivous, but in the documentation I haven't found any information about how to access |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Yes, you're right this isn't in the docs. We need to add that. You can access it in the action by declaring a from burr.core import action, State, ApplicationContext
@action(reads=["..."], writes=["..."])
def my_action(state: State, __context: ApplicationContext) -> State:
print(__context.app_id, __context.partition_key, __context.sequence_id)
... |
Beta Was this translation helpful? Give feedback.
-
Thanks for the answer @skrawcz . Can you please also add an example achieving the same but with a class-based action? |
Beta Was this translation helpful? Give feedback.
Yes, you're right this isn't in the docs. We need to add that. You can access it in the action by declaring a
__context: ApplicationContext
parameter, and then accessing it like so:See this notebook for example usage.