You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The import notification policy to use when an import is triggered during workflow loading or execution. See :py:class:`temporalio.workflow.SandboxImportNotificationPolicy` for options.
An import notification policy that enables warnings on dynamic imports during a
155
+
workflow and imports that are unintentionally passed through to the sandbox.
156
+
Equivalent to :py:attr:`temporalio.workflow.SandboxImportNotificationPolicy.WARN_ON_DYNAMIC_IMPORT` | :py:attr:`temporalio.workflow.SandboxImportNotificationPolicy.WARN_ON_UNINTENTIONAL_PASSTHROUGH`
An import notification policy that enables warnings on dynamic imports during a
164
+
workflow and raises an error when imports are unintentionally passed through to the sandbox.
165
+
Equivalent to :py:attr:`temporalio.workflow.SandboxImportNotificationPolicy.WARN_ON_DYNAMIC_IMPORT` | :py:attr:`temporalio.workflow.SandboxImportNotificationPolicy.RAISE_ON_UNINTENTIONAL_PASSTHROUGH`
# TODO(amazzeo): this name is confusing with existing import passthrough phrasing.
1416
-
classSandboxImportPolicy(Flag):
1417
-
# TODO(amazzeo): Need to establish consistent phrasing about the time this is applied
1418
-
"""Defines the behavior taken when modules are imported into the sandbox after the workflow is initially loaded."""
1416
+
classSandboxImportNotificationPolicy(Flag):
1417
+
"""Defines the behavior taken when modules are imported into the sandbox after the workflow is initially loaded or unintentionally missing from the passthrough list."""
1419
1418
1420
-
UNSET=auto()
1421
-
"""All imports that do not violate sandbox restrictions are allowed and no warning is generated."""
1419
+
SILENT=auto()
1420
+
"""Allow imports that do not violate sandbox restrictions and no warnings are generated."""
1422
1421
WARN_ON_DYNAMIC_IMPORT=auto()
1423
-
"""Issue a warning when an import is triggered in the sandbox after initial workflow load."""
1424
-
WARN_ON_NON_PASSTHROUGH=auto()
1425
-
"""Issue a warning when an import is triggered in the sandbox that was not passed through."""
1426
-
RAISE_ON_NON_PASSTHROUGH=auto()
1427
-
"""Raise an error when an import is triggered in the sandbox that was not passed through."""
1428
-
1429
-
1430
-
_sandbox_import_policy=threading.local()
1422
+
"""Allows dynamic imports that do not violate sandbox restrictions but issues a warning when an import is triggered in the sandbox after initial workflow load."""
1423
+
WARN_ON_UNINTENTIONAL_PASSTHROUGH=auto()
1424
+
"""Allows imports that do not violate sandbox restrictions but issues a warning when an import is triggered in the sandbox that was unintentionally passed through."""
1425
+
RAISE_ON_UNINTENTIONAL_PASSTHROUGH=auto()
1426
+
"""Raise an error when an import is triggered in the sandbox that was unintentionally passed through."""
0 commit comments