Module load.array in plugin tabular v0.5.1
Deserialize array data.
| Author(s) | Markus Binsteiner (markus@frkl.io) |
| Tags | tabular |
| Python class | kiara_plugin.tabular.modules.array.DeserializeArrayModule |
Module configuration options
Configuration class: kiara.modules.included_core_modules.serialization.SerializeConfig
| Name | Description | Type | Required? | Default |
|---|---|---|---|---|
| serialization_profile | The name of the serialization profile used to serialize the source value. | string | true | null |
| target_profile | The profile name of the de-serialization result data. | string | true | null |
| value_type | The value type of the actual (unserialized) value. | string | true | null |
| constants | Value constants for this module. | object | false | null |
| defaults | Value defaults for this module. | object | false | null |
Module source code
class DeserializeArrayModule(DeserializeValueModule): """Deserialize array data."""
_module_type_name = "load.array"
@classmethod def retrieve_supported_target_profiles(cls) -> Mapping[str, Type]: return {"python_object": KiaraArray}
@classmethod def retrieve_serialized_value_type(cls) -> str: return "array"
@classmethod def retrieve_supported_serialization_profile(cls) -> str: return "feather"
def to__python_object(self, data: SerializedData, **config: Any):
assert "array.arrow" in data.get_keys() and len(list(data.get_keys())) == 1
chunks = data.get_serialized_data("array.arrow")
# TODO: support multiple chunks assert chunks.get_number_of_chunks() == 1 files = list(chunks.get_chunks(as_files=True, symlink_ok=True)) assert len(files) == 1
array_file = files[0]
array = KiaraArray(data_path=array_file) return array