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
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
Copy link
Contributor

@schustmi schustmi left a comment

Choose a reason for hiding this comment

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

When I run e.g. zenml stack list -o json > stacks.json, this doesn't produce a valid JSON file yet.

@safoinme
Copy link
Contributor Author

safoinme commented Dec 1, 2025

@schustmi issue was with added syntax_highlight function, it should be fixed now

@safoinme safoinme requested a review from schustmi December 1, 2025 09:14
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.

I am a bit tight on time so I was not able to review the utils in much detail. I left some comments again.

safoinme and others added 2 commits December 1, 2025 13:37
Co-authored-by: Barış Can Durak <36421093+bcdurak@users.noreply.github.com>
@safoinme safoinme merged commit 99be873 into develop Dec 2, 2025
80 of 84 checks passed
@safoinme safoinme deleted the feature/improve-cli-tables branch December 2, 2025 11:06
@strickvl strickvl added the release-notes Release notes will be attached and used publicly for this PR. label Dec 2, 2025
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 release-notes Release notes will be attached and used publicly for this PR. 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.

8 participants