Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zenml stack describe bug #476

Merged
merged 4 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/zenml/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ def print_stack_configuration(
)
rich_table.add_column("COMPONENT_TYPE")
rich_table.add_column("COMPONENT_NAME")
items = {typ.value: name for typ, name in config.items()}
items = ([typ.value, name] for typ, name in config.items())
for item in items:
rich_table.add_row(*list(item))
rich_table.add_row(*item)

# capitalize entries in first column
rich_table.columns[0]._cells = [
Expand Down
2 changes: 1 addition & 1 deletion src/zenml/steps/base_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def __call__(
)

self.INPUT_SPEC = {
arg_name: artifact_type.type # type:ignore[misc]
htahir1 marked this conversation as resolved.
Show resolved Hide resolved
arg_name: artifact_type.type
for arg_name, artifact_type in input_artifacts.items()
}

Expand Down
15 changes: 15 additions & 0 deletions tests/unit/cli/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from hypothesis.strategies import datetimes

from zenml.cli.utils import format_date, parse_unknown_options
from zenml.repository import Repository

SAMPLE_CUSTOM_ARGUMENTS = [
'--custom_argument="value"',
Expand All @@ -41,3 +42,17 @@ def test_parse_unknown_options_returns_a_dict_of_known_options() -> None:
assert isinstance(parsed_sample_args, dict)
assert len(parsed_sample_args.values()) == 3
assert parsed_sample_args["best_cat"] == '"aria"'


def test_stack_config_has_right_contents_for_printing() -> None:
"""Check that the stack config has the right components for printing"""
repo = Repository()
htahir1 marked this conversation as resolved.
Show resolved Hide resolved
active_stack_name = repo.active_stack_name
stack_config = repo.stack_configurations[active_stack_name]
items = [[typ.value, name] for typ, name in stack_config.items()]
assert len(items) != 0
assert items is not None
for item in items:
assert isinstance(item, list)
for kv_pair in item:
assert isinstance(kv_pair, str)