prefect.context
prefect.runtime
.
serialize_context
hydrated_context
get_run_context
FlowRunContext
or TaskRunContext
depending on the function type.RuntimeError
: If called outside of a flow or task run.get_settings_context
prefect.context.use_profile
for more details.
tags
use_profile
profile
: The name of the profile to load or an instance of a Profile.override_environment_variable
: If set, variables in the profile will take
precedence over current environment variables. By default, environment
variables will override profile settings.include_current_context
: If set, the new settings will be constructed
with the current settings context as a base. If not set, the use_base settings
will be loaded from the environment and defaults.root_settings_context
ContextModel
get
model_copy
serialize
SyncClientContext
get_or_create
AsyncClientContext
get_or_create
RunContext
get_run_context
is called.
Methods:
serialize
EngineContext
serialize
TaskRunContext
serialize
AssetContext
from_task_and_inputs
task
: The task instancetask_run_id
: The task run IDtask_inputs
: The resolved task inputs (TaskRunResult objects)copy_to_child_ctx
: Whether this context should be copied on a child AssetContextadd_asset_metadata
asset_key
: The asset keymetadata
: Metadata dictionary to addValueError
: If asset_key is not in downstream_assetsasset_as_resource
asset_as_related
related_materialized_by
emit_events
update_tracked_assets
serialize
TagsContext
prefect.tags
management.
Methods:
get
SettingsContext
get