From bc09e990864507f5668078dce918c9e6c25097be Mon Sep 17 00:00:00 2001 From: JamieDeMaria Date: Tue, 19 Dec 2023 14:37:44 -0500 Subject: [PATCH] comments --- .../dagster/_core/execution/context/invocation.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python_modules/dagster/dagster/_core/execution/context/invocation.py b/python_modules/dagster/dagster/_core/execution/context/invocation.py index bdd18be343880..6277a930f395d 100644 --- a/python_modules/dagster/dagster/_core/execution/context/invocation.py +++ b/python_modules/dagster/dagster/_core/execution/context/invocation.py @@ -81,6 +81,11 @@ class BoundProperties( ], ) ): + """Maintains properties that are only available once the context has been bound to a particular + asset or op execution. By splitting these out into a separate object, it is easier to ensure that + all properties bound to an execution are cleared once the execution is complete. + """ + def __new__( cls, op_def: OpDefinition, @@ -92,7 +97,6 @@ def __new__( op_config: Any, step_description: str, ): - """Maintains the properties of the context that are provided at bind time.""" return super(BoundProperties, cls).__new__( cls, op_def=check.inst_param(op_def, "op_def", OpDefinition), @@ -107,9 +111,9 @@ def __new__( class DirectExecutionProperties: - """Maintains information about the invocation that is updated during execution time. This information - needs to be available to the user once invocation is complete, so that they can assert on events and - outputs. It needs to be cleared before the context is used for another invocation. + """Maintains information about the execution that can only be updated during execution (when + the context is bound), but can be read after execution is complete. It needs to be cleared before + the context is used for another execution. This is not implemented as a NamedTuple because the various attributes will be mutated during execution.