feat(cli): add --no-trunc flag for commands that output rich tables#797
Merged
Conversation
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>
Member
Author
ExampleTerminal with 90x54 res default behaviourwith
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
--no-truncflag 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.pyAdded the
--no-trunccommand-line option to theget_resourcecommand and passed it through to the command parameters.📄
orchestrator/cli/commands/show_entities.pyAdded the
--no-trunccommand-line option to theshow_entities_for_resourcescommand and passed it through to the command parameters.📄
orchestrator/cli/commands/show_requests.pyAdded the
--no-trunccommand-line option to theshow_requests_for_resourcescommand and passed it through to the command parameters.📄
orchestrator/cli/commands/show_results.pyAdded the
--no-trunccommand-line option to theshow_results_for_resourcescommand and passed it through to the command parameters.📄
orchestrator/cli/models/parameters.pyAdded
no_trunc: boolfield to multiple parameter models:AdoGetCommandParameters,AdoShowEntitiesCommandParameters,AdoShowRequestsCommandParameters, andAdoShowResultsCommandParameters.📄
orchestrator/cli/resources/actuator/get.pyUpdated
dataframe_to_rich_tablecall to include thedo_not_truncate_column_contentparameter based onparameters.no_trunc.📄
orchestrator/cli/resources/context/get.pyUpdated
dataframe_to_rich_tablecall to include thedo_not_truncate_column_contentparameter based onparameters.no_trunc.📄
orchestrator/cli/resources/discovery_space/get.pyUpdated multiple
dataframe_to_rich_tablecalls to include thedo_not_truncate_column_contentparameter based onparameters.no_trunc.📄
orchestrator/cli/resources/discovery_space/show_entities.pyUpdated
df_to_outputcall to pass through theno_truncparameter.📄
orchestrator/cli/resources/experiment/get.pyUpdated
dataframe_to_rich_tablecall to include thedo_not_truncate_column_contentparameter based onparameters.no_trunc.📄
orchestrator/cli/resources/operation/show_entities.pyUpdated
df_to_outputcall to pass through theno_truncparameter.📄
orchestrator/cli/resources/operation/show_requests.pyUpdated
df_to_outputcall to pass through theno_truncparameter.📄
orchestrator/cli/resources/operation/show_results.pyUpdated
df_to_outputcall to pass through theno_truncparameter.📄
orchestrator/cli/resources/operator/get.pyUpdated
dataframe_to_rich_tablecall to include thedo_not_truncate_column_contentparameter based onparameters.no_trunc.📄
orchestrator/cli/utils/output/dataframes.pyAdded
no_truncparameter to thedf_to_outputfunction and passed it through todataframe_to_rich_tableasdo_not_truncate_column_content.📄
orchestrator/cli/utils/resources/handlers.pyUpdated multiple
dataframe_to_rich_tablecalls to include thedo_not_truncate_column_contentparameter based onparameters.no_trunc.📄
orchestrator/utilities/rich.pyCore implementation of the no-truncation feature. Added three new parameters to
dataframe_to_rich_table:overflow,no_wrap, anddo_not_truncate_column_content. Whendo_not_truncate_column_contentis 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".