Datasource¶
- class dagshub.data_engine.model.metadata_field_builder.MetadataFieldBuilder(datasource, field_name)¶
Builder class for changing properties of a metadata field in a datasource. It is also possible to create a new empty field with predefined schema with this builder. All functions return back the builder object to facilitate a builder pattern, for example:
builder.set_type(bytes).set_annotation().apply()
- set_type(t) MetadataFieldBuilder¶
Set the type of the field. The type can be either a Python primitive supported by the Data Engine (
str,bool,int,float,bytes) or it can be aDagshubDataTypeinheritor. The DataType inheritors can define additional tags on top of just the basic backing type- Return type:
- set_annotation(is_annotation=True) MetadataFieldBuilder¶
Mark or unmark the field as annotation field
- Return type:
- set_thumbnail(thumbnail_type=None, is_thumbnail=True) MetadataFieldBuilder¶
Mark or unmark the field as thumbnail field, with the specified thumbnail type
- Return type:
- apply()¶
Apply the outgoing changes to this metadata field.
If you need to apply changes to multiple fields at once, use
Datasource.apply_field_changesinstead.