Skip to content

Conversation

@safoinme
Copy link
Contributor

@safoinme safoinme commented Nov 21, 2025

Describe changes

This PR refactors the ZenML CLI table rendering system to:

  • Enable pipeable output (JSON/YAML/CSV/TSV) by separating stdout/stderr
  • Consolidate table rendering logic into centralized functions
  • Improve table aesthetics with intelligent column sizing
  • Simplify CLI command implementations across artifact, model, tag, and deployment commands

Key technical changes:

  • New zenml_cli module for stdout/stderr routing
  • New rendering functions: render_list_output(), handle_output(), prepare_output()
  • Enhanced list_options decorator with auto-rendering support
  • Column width management with protected widths for IDs (36), URLs (40), status (18)

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • I have based my new branch on develop and the open PR is targeting develop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.
  • IMPORTANT: I made sure that my changes are reflected properly in the following resources:
    • ZenML Docs
    • Dashboard: Needs to be communicated to the frontend team.
    • Templates: Might need adjustments (that are not reflected in the template tests) in case of non-breaking changes and deprecations.
    • Projects: Depending on the version dependencies, different projects might get affected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

znegrin and others added 30 commits July 30, 2025 11:18
Add missing parameter documentation and return values for CLI
display functions to resolve CI docstring validation errors.
This includes fixes for service connectors, table utilities,
tags, pipelines, stack components, models, artifacts, authorized
devices, secrets, and service accounts.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Complete the docstring fixes for artifact versions and ensure all
critical CLI table functions have proper parameter and return documentation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add missing Args and Returns sections to functions in model.py
- Fix docstring issues in stack_components.py flavor functions
- Add parameter documentation to code_repository.py
- Fix utils.py print_page_info docstring
- Complete user_management.py docstring documentation
- Add missing documentation to project.py functions

All darglint docstring validation errors are now resolved for CLI files.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Fix Page[T] vs List[Any] type mismatches in prepare_list_data calls
- Add type ignore comments for model_dump no-any-return issues
- Fix missing type annotations in user_management.py
- Handle object vs List[Any] issues with proper type ignore comments
- Ensure proper handling of paginated vs non-paginated responses

Resolves all remaining mypy errors that were causing CI failures.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Fix line formatting in project.py, service_accounts.py, tag.py, user_management.py
- Ensure consistent formatting across all modified CLI files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@znegrin
Copy link
Contributor

znegrin commented Nov 25, 2025

If I do zenml artifact version list it shows weird spacing between rows:
image

I think it is probably related to this column:
image

Same with model versions:
image

@safoinme
Copy link
Contributor Author

@znegrin all the issues you pointed have been adressed, the issue behind this is that we needed to specify which default column to pass. the extra spacing is also adressed

@znegrin
Copy link
Contributor

znegrin commented Nov 25, 2025

After checking a few outputs, I feel we could add some spacing, maybe always having one space before the list header, and showing the pagination between two spaces to make it cleaner. Also having a bit of padding to the left of the list so it is not so tight. Example:

Existing:
image

Proposal:
image

Copy link
Contributor

@Json-Andriopoulos Json-Andriopoulos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments here and there - some are suggestions/enhancements but we should mainly on the comments regarding rendering consistency.

Good work overall!

@safoinme
Copy link
Contributor Author

@znegrin @Json-Andriopoulos @schustmi @bcdurak all clear comments are adressed, i have left some unresolved because i didn't understand or we have decided in the spec to follow different approach for

@safoinme safoinme requested review from schustmi and znegrin November 25, 2025 11:45
Copy link
Contributor

@bcdurak bcdurak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just found one more small detail. Also unresolved and left a comment regarding the piping.

@safoinme safoinme requested a review from bcdurak November 25, 2025 15:25
requires = ["uv_build >= 0.8.17, <0.9.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@safoinme Can you check if this behaves correctly in the following cases:

  • Fresh install in a virtualenv
  • Upgrading an existing ZenML installation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes both works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request internal To filter out internal PRs and issues run-slow-ci Tag that is used to trigger the slow-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants