Skip to content

feat(cli): add --no-trunc flag for commands that output rich tables#797

Merged
AlessandroPomponio merged 4 commits into
mainfrom
ap_796_add_no_trunc
Apr 7, 2026
Merged

feat(cli): add --no-trunc flag for commands that output rich tables#797
AlessandroPomponio merged 4 commits into
mainfrom
ap_796_add_no_trunc

Conversation

@AlessandroPomponio
Copy link
Copy Markdown
Member

Summary

This PR adds a new --no-trunc flag across multiple CLI commands to prevent truncation of table content in console output. When enabled, columns are automatically sized to fit all content without truncation, ensuring complete visibility of data in table displays.

Resolves #796

Files Changed

📄 orchestrator/cli/commands/get.py

Added the --no-trunc command-line option to the get_resource command and passed it through to the command parameters.

📄 orchestrator/cli/commands/show_entities.py

Added the --no-trunc command-line option to the show_entities_for_resources command and passed it through to the command parameters.

📄 orchestrator/cli/commands/show_requests.py

Added the --no-trunc command-line option to the show_requests_for_resources command and passed it through to the command parameters.

📄 orchestrator/cli/commands/show_results.py

Added the --no-trunc command-line option to the show_results_for_resources command and passed it through to the command parameters.

📄 orchestrator/cli/models/parameters.py

Added no_trunc: bool field to multiple parameter models: AdoGetCommandParameters, AdoShowEntitiesCommandParameters, AdoShowRequestsCommandParameters, and AdoShowResultsCommandParameters.

📄 orchestrator/cli/resources/actuator/get.py

Updated dataframe_to_rich_table call to include the do_not_truncate_column_content parameter based on parameters.no_trunc.

📄 orchestrator/cli/resources/context/get.py

Updated dataframe_to_rich_table call to include the do_not_truncate_column_content parameter based on parameters.no_trunc.

📄 orchestrator/cli/resources/discovery_space/get.py

Updated multiple dataframe_to_rich_table calls to include the do_not_truncate_column_content parameter based on parameters.no_trunc.

📄 orchestrator/cli/resources/discovery_space/show_entities.py

Updated df_to_output call to pass through the no_trunc parameter.

📄 orchestrator/cli/resources/experiment/get.py

Updated dataframe_to_rich_table call to include the do_not_truncate_column_content parameter based on parameters.no_trunc.

📄 orchestrator/cli/resources/operation/show_entities.py

Updated df_to_output call to pass through the no_trunc parameter.

📄 orchestrator/cli/resources/operation/show_requests.py

Updated df_to_output call to pass through the no_trunc parameter.

📄 orchestrator/cli/resources/operation/show_results.py

Updated df_to_output call to pass through the no_trunc parameter.

📄 orchestrator/cli/resources/operator/get.py

Updated dataframe_to_rich_table call to include the do_not_truncate_column_content parameter based on parameters.no_trunc.

📄 orchestrator/cli/utils/output/dataframes.py

Added no_trunc parameter to the df_to_output function and passed it through to dataframe_to_rich_table as do_not_truncate_column_content.

📄 orchestrator/cli/utils/resources/handlers.py

Updated multiple dataframe_to_rich_table calls to include the do_not_truncate_column_content parameter based on parameters.no_trunc.

📄 orchestrator/utilities/rich.py

Core implementation of the no-truncation feature. Added three new parameters to dataframe_to_rich_table: overflow, no_wrap, and do_not_truncate_column_content. When do_not_truncate_column_content is enabled, the function calculates the maximum width needed for each column (considering both header and content), sets appropriate overflow and wrapping settings, and configures the table with fixed column widths to prevent any truncation. Also standardized the default index name to "INDEX".

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
@AlessandroPomponio
Copy link
Copy Markdown
Member Author

Example

Terminal with 90x54 res

default behaviour

…do-core) alessandropomponio@MacBook-Pro-di-Alessandro ~/D/G/p/ado (ap_796_add_no_trunc)> ado get operations
┌───────┬───────────────┬───────────────┬───────────────┬──────────┬────────────┬────────┐
│ INDEX │ IDENTIFIER    │ NAME          │ SPACE         │ STATUS   │ EXIT_STATE │ AGE    │
├───────┼───────────────┼───────────────┼───────────────┼──────────┼────────────┼────────┤
│ 0     │ randomwalk-1… │               │ space-fa68da… │ finished │ success    │ 39d4h  │
│ 1     │ raytune-1.5.… │               │ space-fa68da… │ finished │ error      │ 39d4h  │
│ 2     │ raytune-1.5.… │               │ space-fa68da… │ finished │ fail       │ 39d4h  │
│ 3     │ raytune-1.5.… │               │ space-fa68da… │ finished │ fail       │ 39d4h  │
│ 4     │ raytune-1.5.… │               │ space-fa68da… │ finished │ success    │ 39d4h  │
│ 5     │ randomwalk-1… │               │ space-c5ed89… │ finished │ success    │ 35d22h │
│ 6     │ raytune-1.5.… │               │ space-c5ed89… │ finished │ error      │ 35d22h │
│ 7     │ raytune-1.5.… │               │ space-1d0af4… │ finished │ fail       │ 35d21h │
│ 8     │ raytune-1.5.… │               │ space-1d0af4… │ finished │ fail       │ 35d21h │
│ 9     │ raytune-1.5.… │               │ space-1d0af4… │ finished │ success    │ 35d21h │
│ 10    │ raytune-1.5.… │               │ space-1d0af4… │ finished │ success    │ 35d21h │
│ 11    │ raytune-1.5.… │               │ space-580a28… │ finished │ error      │ 35d21h │
│ 12    │ raytune-1.5.… │               │ space-580a28… │ finished │ success    │ 35d21h │
│ 13    │ raytune-1.5.… │               │ space-580a28… │ finished │ success    │ 35d20h │
│ 14    │ raytune-1.5.… │               │ space-580a28… │ started  │ N/A        │ 35d19h │
│ 15    │ raytune-1.5.… │               │ space-580a28… │ started  │ N/A        │ 35d19h │
│ 16    │ raytune-1.5.… │               │ space-c7460d… │ started  │ N/A        │ 35d5h  │
│ 17    │ raytune-1.5.… │               │ space-c7460d… │ started  │ N/A        │ 35d2h  │
│ 18    │ raytune-1.5.… │               │ space-5987ee… │ finished │ fail       │ 34d5h  │
│ 19    │ raytune-1.5.… │               │ space-5987ee… │ finished │ fail       │ 34d5h  │
│ 20    │ raytune-1.5.… │               │ space-5987ee… │ finished │ fail       │ 34d3h  │
│ 21    │ raytune-1.5.… │               │ space-5987ee… │ finished │ error      │ 32d23h │
│ 22    │ raytune-1.5.… │               │ space-5987ee… │ finished │ error      │ 32d4h  │
│ 23    │ raytune-1.5.… │               │ space-5987ee… │ finished │ success    │ 31d24h │
│ 24    │ raytune-1.6.… │               │ space-8e4272… │ finished │ success    │ 29d6h  │
│ 25    │ raytune-1.6.… │               │ space-c4adbf… │ finished │ success    │ 27d19h │
│ 26    │ raytune-1.6.… │               │ space-0df572… │ finished │ success    │ 26d22h │
│ 27    │ raytune-1.6.… │               │ space-5537e4… │ finished │ success    │ 26d1h  │
│ 28    │ raytune-1.6.… │               │ space-fbcbc7… │ finished │ success    │ 26d1h  │
│ 29    │ raytune-1.6.… │               │ space-226bd2… │ finished │ error      │ 25d17h │
│ 30    │ operation-ti… │ cplex_rank_m… │ space-fbcbc7… │ finished │ success    │ 5d22h  │
│ 31    │ operation-ti… │ cplex_rank_m… │ space-5537e4… │ finished │ success    │ 5d22h  │
│ 32    │ operation-ti… │ cplex_rank_m… │ space-226bd2… │ finished │ success    │ 5d22h  │
│ 33    │ operation-ti… │ cplex_rank_o… │ space-5537e4… │ finished │ success    │ 5d22h  │
│ 34    │ operation-ti… │ cplex_rank_o… │ space-fbcbc7… │ finished │ success    │ 5d22h  │
│ 35    │ operation-ti… │ cplex_rank_o… │ space-226bd2… │ finished │ success    │ 5d22h  │
│ 36    │ operation-ti… │ cplex_rank_b… │ space-5537e4… │ finished │ success    │ 5d22h  │
│ 37    │ operation-ti… │ cplex_rank_b… │ space-fbcbc7… │ finished │ success    │ 5d22h  │
│ 38    │ operation-ti… │ cplex_rank_b… │ space-226bd2… │ finished │ success    │ 5d22h  │
│ 39    │ raytune-1.7.… │               │ space-6aeea0… │ finished │ success    │ 4d21h  │
└───────┴───────────────┴───────────────┴───────────────┴──────────┴────────────┴────────┘

with --no-trunc

…do-core) alessandropomponio@MacBook-Pro-di-Alessandro ~/D/G/p/ado (ap_796_add_no_trunc)> ado get operations --no-trunc
┌───────┬──────────────────────────────────────────────────────┬──────────────────────────────────────────────────┬──────────────────────┬──────────┬────────────┬────────┐
│ INDEX │ IDENTIFIER                                           │ NAME                                             │ SPACE                │ STATUS   │ EXIT_STATE │ AGE    │
├───────┼──────────────────────────────────────────────────────┼──────────────────────────────────────────────────┼──────────────────────┼──────────┼────────────┼────────┤
│ 0     │ randomwalk-1.5.0-533226                              │                                                  │ space-fa68da-default │ finished │ success    │ 39d5h  │
│ 1     │ raytune-1.5.0-lhu_sampler-d172b4                     │                                                  │ space-fa68da-default │ finished │ error      │ 39d4h  │
│ 2     │ raytune-1.5.0-lhu_sampler-810ec9                     │                                                  │ space-fa68da-default │ finished │ fail       │ 39d4h  │
│ 3     │ raytune-1.5.0-lhu_sampler-405846                     │                                                  │ space-fa68da-default │ finished │ fail       │ 39d4h  │
│ 4     │ raytune-1.5.0-lhu_sampler-cce9a0                     │                                                  │ space-fa68da-default │ finished │ success    │ 39d4h  │
│ 5     │ randomwalk-1.5.0-10e15a                              │                                                  │ space-c5ed89-default │ finished │ success    │ 35d22h │
│ 6     │ raytune-1.5.0-lhu_sampler-551649                     │                                                  │ space-c5ed89-default │ finished │ error      │ 35d22h │
│ 7     │ raytune-1.5.0-lhu_sampler-205f3e                     │                                                  │ space-1d0af4-default │ finished │ fail       │ 35d21h │
│ 8     │ raytune-1.5.0-lhu_sampler-299ba0                     │                                                  │ space-1d0af4-default │ finished │ fail       │ 35d21h │
│ 9     │ raytune-1.5.0-lhu_sampler-ecef93                     │                                                  │ space-1d0af4-default │ finished │ success    │ 35d21h │
│ 10    │ raytune-1.5.0-lhu_sampler-dff77e                     │                                                  │ space-1d0af4-default │ finished │ success    │ 35d21h │
│ 11    │ raytune-1.5.0-lhu_sampler-1e46dd                     │                                                  │ space-580a28-9d5d0a  │ finished │ error      │ 35d21h │
│ 12    │ raytune-1.5.0-lhu_sampler-c01e8e                     │                                                  │ space-580a28-9d5d0a  │ finished │ success    │ 35d21h │
│ 13    │ raytune-1.5.0-lhu_sampler-8c0796                     │                                                  │ space-580a28-9d5d0a  │ finished │ success    │ 35d21h │
│ 14    │ raytune-1.5.0-lhu_sampler-44f5cc                     │                                                  │ space-580a28-9d5d0a  │ started  │ N/A        │ 35d19h │
│ 15    │ raytune-1.5.0-lhu_sampler-4e2deb                     │                                                  │ space-580a28-9d5d0a  │ started  │ N/A        │ 35d19h │
│ 16    │ raytune-1.5.0-lhu_sampler-78fb50                     │                                                  │ space-c7460d-60cc4f  │ started  │ N/A        │ 35d5h  │
│ 17    │ raytune-1.5.0-lhu_sampler-ae1770                     │                                                  │ space-c7460d-60cc4f  │ started  │ N/A        │ 35d2h  │
│ 18    │ raytune-1.5.0-lhu_sampler-cda08e                     │                                                  │ space-5987ee-default │ finished │ fail       │ 34d5h  │
│ 19    │ raytune-1.5.1.dev57+dafa22d.dirty-lhu_sampler-1ba4e2 │                                                  │ space-5987ee-default │ finished │ fail       │ 34d5h  │
│ 20    │ raytune-1.5.1.dev59+b109427.dirty-lhu_sampler-ec2a03 │                                                  │ space-5987ee-default │ finished │ fail       │ 34d3h  │
│ 21    │ raytune-1.5.1.dev62+b4a9ad9.dirty-lhu_sampler-c27132 │                                                  │ space-5987ee-default │ finished │ error      │ 32d23h │
│ 22    │ raytune-1.5.1.dev63+1d19bd7.dirty-lhu_sampler-229507 │                                                  │ space-5987ee-default │ finished │ error      │ 32d4h  │
│ 23    │ raytune-1.5.1.dev67+c96cc4d.dirty-lhu_sampler-2e5c01 │                                                  │ space-5987ee-default │ finished │ success    │ 31d24h │
│ 24    │ raytune-1.6.1.dev20+517b476.dirty-optuna-eea0f4      │                                                  │ space-8e4272-default │ finished │ success    │ 29d6h  │
│ 25    │ raytune-1.6.1.dev35+c0888ef.dirty-optuna-0d2d22      │                                                  │ space-c4adbf-default │ finished │ success    │ 27d19h │
│ 26    │ raytune-1.6.1.dev35+c0888ef.dirty-optuna-e556e6      │                                                  │ space-0df572-default │ finished │ success    │ 26d22h │
│ 27    │ raytune-1.6.1.dev35+c0888ef.dirty-lhu_sampler-fdf19b │                                                  │ space-5537e4-default │ finished │ success    │ 26d1h  │
│ 28    │ raytune-1.6.1.dev35+c0888ef.dirty-lhu_sampler-f65a1e │                                                  │ space-fbcbc7-default │ finished │ success    │ 26d1h  │
│ 29    │ raytune-1.6.1.dev36+1ecfd6a.dirty-lhu_sampler-ba584f │                                                  │ space-226bd2-default │ finished │ error      │ 25d17h │
│ 30    │ operation-timeseries_ranking-1.0-1acc2b10            │ cplex_rank_mip_gap_sorrell3_refined_60m          │ space-fbcbc7-default │ finished │ success    │ 5d22h  │
│ 31    │ operation-timeseries_ranking-1.0-cd21d3be            │ cplex_rank_mip_gap_bab6_refined_60m              │ space-5537e4-default │ finished │ success    │ 5d22h  │
│ 32    │ operation-timeseries_ranking-1.0-3d8a6183            │ cplex_rank_mip_gap_atlanta_ip_refined_60m        │ space-226bd2-default │ finished │ success    │ 5d22h  │
│ 33    │ operation-timeseries_ranking-1.0-c0b3a045            │ cplex_rank_objective_mip_bab6_refined_60m        │ space-5537e4-default │ finished │ success    │ 5d22h  │
│ 34    │ operation-timeseries_ranking-1.0-f9acd7eb            │ cplex_rank_objective_mip_sorrell3_refined_60m    │ space-fbcbc7-default │ finished │ success    │ 5d22h  │
│ 35    │ operation-timeseries_ranking-1.0-0311d8c2            │ cplex_rank_objective_mip_atlanta_ip_refined_60m  │ space-226bd2-default │ finished │ success    │ 5d22h  │
│ 36    │ operation-timeseries_ranking-1.0-c5f160cc            │ cplex_rank_best_bound_mip_bab6_refined_60m       │ space-5537e4-default │ finished │ success    │ 5d22h  │
│ 37    │ operation-timeseries_ranking-1.0-c2e8487b            │ cplex_rank_best_bound_mip_sorrell3_refined_60m   │ space-fbcbc7-default │ finished │ success    │ 5d22h  │
│ 38    │ operation-timeseries_ranking-1.0-8b81adff            │ cplex_rank_best_bound_mip_atlanta_ip_refined_60m │ space-226bd2-default │ finished │ success    │ 5d22h  │
│ 39    │ raytune-1.7.1.dev58+d8be1ae.dirty-optuna-72f5e5      │                                                  │ space-6aeea0-default │ finished │ success    │ 4d21h  │
└───────┴──────────────────────────────────────────────────────┴──────────────────────────────────────────────────┴──────────────────────┴──────────┴────────────┴────────┘

Copy link
Copy Markdown
Member

@michael-johnston michael-johnston left a comment

Choose a reason for hiding this comment

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

LGTM

@AlessandroPomponio AlessandroPomponio added this pull request to the merge queue Apr 7, 2026
Merged via the queue into main with commit 2d5ec00 Apr 7, 2026
19 checks passed
@AlessandroPomponio AlessandroPomponio deleted the ap_796_add_no_trunc branch April 7, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): add --no-trunc option to avoid truncating tables to terminal width

2 participants