Skip to content

Commit

Permalink
chore: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
makkus committed Jul 17, 2024
1 parent d419213 commit bed249d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ jobs:
name: conda-pkgs
path: build-dir/
- name: release conda package
run: kiara build conda publish --user dharpa --channel dharpa --token ${{ secrets.ANACONDA_PUSH_TOKEN }} build-dir
run: kiara build conda publish --user dharpa --channel main --token ${{ secrets.ANACONDA_PUSH_TOKEN }} build-dir


merge_tag_to_main:
Expand Down
3 changes: 3 additions & 0 deletions src/kiara/data_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,17 @@ def _pre_examine_data(
serialized = data
not_serialized: bool = False
else:

data = self.parse_python_obj(data)

if data is None:
raise Exception(
f"Invalid data, can't parse into a value of type '{schema.type}'."
)
self._validate(data)

serialized = self.serialize(data)

if serialized is None:
serialized = NO_SERIALIZATION_MARKER

Expand Down
3 changes: 2 additions & 1 deletion src/kiara/data_types/included_core_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def serialize(self, data: bytes) -> "SerializedData":
"environment": {},
"deserialize": {
"python_object": {
"module_name": "load.bytes",
"module_type": "load.bytes",
"module_config": {
"value_type": "bytes",
"target_profile": "python_object",
Expand All @@ -215,6 +215,7 @@ def serialize(self, data: bytes) -> "SerializedData":
from kiara.models.values.value import SerializationResult

serialized = SerializationResult(**serialized_data)

return serialized

def _pretty_print_as__string(
Expand Down
2 changes: 1 addition & 1 deletion src/kiara/models/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def read_bytes(self, length: int = -1) -> bytes:
return content

def __repr__(self):
return f"FileModel(name={self.file_name})"
return f"KiaraFile(name={self.file_name})"

def __str__(self):
return self.__repr__()
Expand Down
3 changes: 3 additions & 0 deletions src/kiara/registries/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,7 @@ def _create_value(
# TODO: check pedigree
return (_existing, False)
else:

if data_type is None:
data_type = self._kiara.type_registry.retrieve_data_type(
data_type_name=schema.type, data_type_config=schema.type_config
Expand Down Expand Up @@ -1396,10 +1397,12 @@ def create_valuemap(
if not str(v):
_v = type(v).__name__
msg.append(f"{k}: {_v}")

raise InvalidValuesException(
msg=f"Can't create values instance: {', '.join(msg)}",
invalid_values={k: str(v) for k, v in failed.items()},
)

return ValueMapReadOnly(value_items=values, values_schema=schema) # type: ignore

def create_renderable(self, **config: Any) -> RenderableType:
Expand Down

0 comments on commit bed249d

Please sign in to comment.