prefect.filesystems
Classes
ReadableFileSystem
Methods:
aload
aload, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, aload
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
name: The name or slug of the block document. A block document slug is a string with the format<block_type_slug>/<block_document_name>validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
annotation_refers_to_block_class
block_initialization
delete
get_block_capabilities
get_block_class_from_key
get_block_class_from_schema
get_block_placeholder
- The block placeholder for the current block in the format
prefect.blocks.{block_type_name}.{block_document_name}
BlockNotSavedError: Raised if the block has not been saved.
None.
get_block_schema_version
get_block_type_name
get_block_type_slug
get_code_example
get_description
is_block_class
load
load, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, load
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
name: The name or slug of the block document. A block document slug is a string with the format<block_type_slug>/<block_document_name>validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
load_from_ref
{"block_document_id": <block_document_id>}{"block_document_slug": <block_document_slug>}
load, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, load
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
ref: The reference to the block document. This can be a block document ID, or one of supported dictionary reference formats.validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If invalid reference format is provided.ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
model_dump
model_json_schema
model_validate
read_path
register_type_and_schema
client: Optional client to use for registering type and schema with the Prefect API. A new client will be created and used if one is not provided.
save
name: User specified name to give saved block document which can later be used to load the block document.overwrite: Boolean value specifying if values should be overwritten if a block document with the specified name already exists.
ser_model
WritableFileSystem
Methods:
aload
aload, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, aload
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
name: The name or slug of the block document. A block document slug is a string with the format<block_type_slug>/<block_document_name>validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
annotation_refers_to_block_class
block_initialization
delete
get_block_capabilities
get_block_class_from_key
get_block_class_from_schema
get_block_placeholder
- The block placeholder for the current block in the format
prefect.blocks.{block_type_name}.{block_document_name}
BlockNotSavedError: Raised if the block has not been saved.
None.
get_block_schema_version
get_block_type_name
get_block_type_slug
get_code_example
get_description
is_block_class
load
load, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, load
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
name: The name or slug of the block document. A block document slug is a string with the format<block_type_slug>/<block_document_name>validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
load_from_ref
{"block_document_id": <block_document_id>}{"block_document_slug": <block_document_slug>}
load, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, load
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
ref: The reference to the block document. This can be a block document ID, or one of supported dictionary reference formats.validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If invalid reference format is provided.ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
model_dump
model_json_schema
model_validate
read_path
register_type_and_schema
client: Optional client to use for registering type and schema with the Prefect API. A new client will be created and used if one is not provided.
save
name: User specified name to give saved block document which can later be used to load the block document.overwrite: Boolean value specifying if values should be overwritten if a block document with the specified name already exists.
ser_model
write_path
ReadableDeploymentStorage
Methods:
aload
aload, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, aload
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
name: The name or slug of the block document. A block document slug is a string with the format<block_type_slug>/<block_document_name>validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
annotation_refers_to_block_class
block_initialization
delete
get_block_capabilities
get_block_class_from_key
get_block_class_from_schema
get_block_placeholder
- The block placeholder for the current block in the format
prefect.blocks.{block_type_name}.{block_document_name}
BlockNotSavedError: Raised if the block has not been saved.
None.
get_block_schema_version
get_block_type_name
get_block_type_slug
get_code_example
get_description
get_directory
is_block_class
load
load, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, load
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
name: The name or slug of the block document. A block document slug is a string with the format<block_type_slug>/<block_document_name>validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
load_from_ref
{"block_document_id": <block_document_id>}{"block_document_slug": <block_document_slug>}
load, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, load
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
ref: The reference to the block document. This can be a block document ID, or one of supported dictionary reference formats.validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If invalid reference format is provided.ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
model_dump
model_json_schema
model_validate
register_type_and_schema
client: Optional client to use for registering type and schema with the Prefect API. A new client will be created and used if one is not provided.
save
name: User specified name to give saved block document which can later be used to load the block document.overwrite: Boolean value specifying if values should be overwritten if a block document with the specified name already exists.
ser_model
WritableDeploymentStorage
Methods:
aload
aload, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, aload
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
name: The name or slug of the block document. A block document slug is a string with the format<block_type_slug>/<block_document_name>validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
annotation_refers_to_block_class
block_initialization
delete
get_block_capabilities
get_block_class_from_key
get_block_class_from_schema
get_block_placeholder
- The block placeholder for the current block in the format
prefect.blocks.{block_type_name}.{block_document_name}
BlockNotSavedError: Raised if the block has not been saved.
None.
get_block_schema_version
get_block_type_name
get_block_type_slug
get_code_example
get_description
get_directory
is_block_class
load
load, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, load
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
name: The name or slug of the block document. A block document slug is a string with the format<block_type_slug>/<block_document_name>validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
load_from_ref
{"block_document_id": <block_document_id>}{"block_document_slug": <block_document_slug>}
load, a warning will be raised.
If the current class schema is a subset of the block document schema, the block
can be loaded as normal using the default validate = True.
If the current class schema is a superset of the block document schema, load
must be called with validate set to False to prevent a validation error. In
this case, the block attributes will default to None and must be set manually
and saved to a new block document before the block can be used as expected.
Args:
ref: The reference to the block document. This can be a block document ID, or one of supported dictionary reference formats.validate: If False, the block document will be loaded without Pydantic validating the block schema. This is useful if the block schema has changed client-side since the block document referred to bynamewas saved.client: The client to use to load the block document. If not provided, the default client will be injected.
ValueError: If invalid reference format is provided.ValueError: If the requested block document is not found.
- An instance of the current class hydrated with the data stored in the
- block document with the specified name.
model_dump
model_json_schema
model_validate
put_directory
register_type_and_schema
client: Optional client to use for registering type and schema with the Prefect API. A new client will be created and used if one is not provided.
save
name: User specified name to give saved block document which can later be used to load the block document.overwrite: Boolean value specifying if values should be overwritten if a block document with the specified name already exists.
ser_model
LocalFileSystem
Store data as a file on a local file system.
Methods:
aget_directory
aput_directory
ignore_file path may be provided that can include gitignore style expressions for filepaths to ignore.
aread_path
awrite_path
cast_pathlib
get_directory
get_directory
put_directory
ignore_file path may be provided that can include gitignore style expressions for filepaths to ignore.
put_directory
read_path
read_path
write_path
write_path
RemoteFileSystem
Store data as a file on a remote file system.
Supports any remote file system supported by fsspec. The file system is specified
using a protocol. For example, “s3://my-bucket/my-folder/” will use S3.
Methods: