Skip to content
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
1 change: 1 addition & 0 deletions orchestrator/cli/commands/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def list_contexts(
matching_space_id=None,
matching_space=None,
minimize_output=True,
no_trunc=False,
output_format=AdoGetSupportedOutputFormats.DEFAULT,
resource_id=None,
resource_type=AdoGetSupportedResourceTypes.CONTEXT,
Expand Down
12 changes: 12 additions & 0 deletions orchestrator/cli/commands/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ def get_resource(
rich_help_panel=OUTPUT_CONFIGURATION_OPTIONS,
),
] = False,
no_trunc: Annotated[
bool,
typer.Option(
"--no-trunc",
help="""
Prevent truncation of table content. When enabled, columns will be sized to fit all content
without truncation. Only applies to default (table) output format.
""",
rich_help_panel=OUTPUT_CONFIGURATION_OPTIONS,
),
] = False,
show_deprecated: Annotated[
bool,
typer.Option(
Expand Down Expand Up @@ -361,6 +372,7 @@ def get_resource(
matching_space_id=matching_space_id,
matching_space=matching_space,
minimize_output=minimize_output,
no_trunc=no_trunc,
output_format=output_format,
resource_id=resource_id,
resource_type=resource_type,
Expand Down
11 changes: 11 additions & 0 deletions orchestrator/cli/commands/show_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ def show_entities_for_resources(
rich_help_panel=SPACE_PANEL_NAME,
),
] = None,
no_trunc: Annotated[
bool,
typer.Option(
"--no-trunc",
help="""
Prevent truncation of table content. When enabled, columns will be sized to fit all content
without truncation. Only applies to console output format.
""",
),
] = False,
) -> None:
"""
Show entities related to a space or an operation and their measurements.
Expand Down Expand Up @@ -184,6 +194,7 @@ def show_entities_for_resources(
entities_output_format=output_format,
entities_property_format=property_format,
entities_type=entity_type,
no_trunc=no_trunc,
properties=properties,
resource_configuration=resource_configuration,
resource_id=resource_id,
Expand Down
11 changes: 11 additions & 0 deletions orchestrator/cli/commands/show_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ def show_requests_for_resources(
""",
),
] = None,
no_trunc: Annotated[
bool,
typer.Option(
"--no-trunc",
help="""
Prevent truncation of table content. When enabled, columns will be sized to fit all content
without truncation. Only applies to console output format.
""",
),
] = False,
) -> None:
"""
Show the timeseries of requests for an operation.
Expand Down Expand Up @@ -114,6 +124,7 @@ def show_requests_for_resources(
parameters = AdoShowRequestsCommandParameters(
ado_configuration=ado_configuration,
hide_fields=hide_fields,
no_trunc=no_trunc,
output_format=output_format,
resource_id=resource_id,
)
Expand Down
11 changes: 11 additions & 0 deletions orchestrator/cli/commands/show_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ def show_results_for_resources(
"Different resource types might support different fields.",
),
] = None,
no_trunc: Annotated[
bool,
typer.Option(
"--no-trunc",
help="""
Prevent truncation of table content. When enabled, columns will be sized to fit all content
without truncation. Only applies to console output format.
""",
),
] = False,
) -> None:
"""
Show the timeseries of results for an operation.
Expand Down Expand Up @@ -109,6 +119,7 @@ def show_results_for_resources(
parameters = AdoShowResultsCommandParameters(
ado_configuration=ado_configuration,
hide_fields=hide_fields,
no_trunc=no_trunc,
output_format=output_format,
resource_id=resource_id,
)
Expand Down
4 changes: 4 additions & 0 deletions orchestrator/cli/models/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class AdoGetCommandParameters(pydantic.BaseModel):
matching_space_id: str | None
matching_space: pathlib.Path | None
minimize_output: bool
no_trunc: bool
output_format: AdoGetSupportedOutputFormats
resource_id: str | None
resource_type: AdoGetSupportedResourceTypes
Expand Down Expand Up @@ -88,6 +89,7 @@ class AdoShowEntitiesCommandParameters(pydantic.BaseModel):
entities_output_format: AdoShowEntitiesSupportedOutputFormats
entities_property_format: AdoShowEntitiesSupportedPropertyFormats
entities_type: AdoShowEntitiesSupportedEntityTypes
no_trunc: bool
properties: list[str] | None
resource_configuration: Path | None
resource_id: str | None
Expand All @@ -101,13 +103,15 @@ class AdoShowRelatedCommandParameters(pydantic.BaseModel):
class AdoShowRequestsCommandParameters(pydantic.BaseModel):
ado_configuration: AdoConfiguration
hide_fields: list[str] | None
no_trunc: bool
output_format: AdoShowRequestsSupportedOutputFormats
resource_id: str


class AdoShowResultsCommandParameters(pydantic.BaseModel):
ado_configuration: AdoConfiguration
hide_fields: list[str] | None
no_trunc: bool
output_format: AdoShowResultsSupportedOutputFormats
resource_id: str

Expand Down
7 changes: 6 additions & 1 deletion orchestrator/cli/resources/actuator/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,10 @@ def get_actuator(parameters: AdoGetCommandParameters) -> None:
return

console_print(
dataframe_to_rich_table(output_df, box=rich.box.SQUARE, show_edge=True)
dataframe_to_rich_table(
output_df,
box=rich.box.SQUARE,
show_edge=True,
do_not_truncate_column_content=parameters.no_trunc,
)
)
6 changes: 5 additions & 1 deletion orchestrator/cli/resources/context/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ def get_context(

console_print(
dataframe_to_rich_table(
contexts_df, show_edge=True, show_index=True, box=rich.box.SQUARE
contexts_df,
show_edge=True,
show_index=True,
box=rich.box.SQUARE,
do_not_truncate_column_content=parameters.no_trunc,
)
)
return
Expand Down
10 changes: 8 additions & 2 deletions orchestrator/cli/resources/discovery_space/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def get_discovery_space(parameters: AdoGetCommandParameters) -> None:
else:
console_print(
dataframe_to_rich_table(
output_df, show_edge=True, box=rich.box.SQUARE
output_df,
show_edge=True,
box=rich.box.SQUARE,
do_not_truncate_column_content=parameters.no_trunc,
)
)

Expand All @@ -88,7 +91,10 @@ def get_discovery_space(parameters: AdoGetCommandParameters) -> None:
else:
console_print(
dataframe_to_rich_table(
output_df, show_edge=True, box=rich.box.SQUARE
output_df,
show_edge=True,
box=rich.box.SQUARE,
do_not_truncate_column_content=parameters.no_trunc,
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def show_discovery_space_entities(parameters: AdoShowEntitiesCommandParameters)
df=output_df,
output_format=parameters.entities_output_format.value,
file_name=file_name,
no_trunc=parameters.no_trunc,
)


Expand Down
7 changes: 6 additions & 1 deletion orchestrator/cli/resources/experiment/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,10 @@ def get_experiment(parameters: AdoGetCommandParameters) -> None:
)

console_print(
dataframe_to_rich_table(output_df, box=rich.box.SQUARE, show_edge=True)
dataframe_to_rich_table(
output_df,
box=rich.box.SQUARE,
show_edge=True,
do_not_truncate_column_content=parameters.no_trunc,
)
)
1 change: 1 addition & 0 deletions orchestrator/cli/resources/operation/show_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ def show_operation_entities(parameters: AdoShowEntitiesCommandParameters) -> Non
df=output_df,
output_format=parameters.entities_output_format.value,
file_name=file_name,
no_trunc=parameters.no_trunc,
)
5 changes: 4 additions & 1 deletion orchestrator/cli/resources/operation/show_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,8 @@ class _COLUMN(enum.Enum):
df = df.drop(parameters.hide_fields, axis="columns")

df_to_output(
df=df, output_format=parameters.output_format.value, file_name=file_name
df=df,
output_format=parameters.output_format.value,
file_name=file_name,
no_trunc=parameters.no_trunc,
)
5 changes: 4 additions & 1 deletion orchestrator/cli/resources/operation/show_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,8 @@ class _COLUMN(enum.Enum):
df = df.drop(parameters.hide_fields, axis="columns")

df_to_output(
df=df, output_format=parameters.output_format.value, file_name=file_name
df=df,
output_format=parameters.output_format.value,
file_name=file_name,
no_trunc=parameters.no_trunc,
)
6 changes: 5 additions & 1 deletion orchestrator/cli/resources/operator/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def get_operator(parameters: AdoGetCommandParameters) -> None:
operators = operators.sort_values(by=["TYPE", "OPERATOR"]).reset_index(drop=True)
console_print(
dataframe_to_rich_table(
operators, show_edge=True, show_index=True, box=rich.box.SQUARE
operators,
show_edge=True,
show_index=True,
box=rich.box.SQUARE,
do_not_truncate_column_content=parameters.no_trunc,
)
)
7 changes: 6 additions & 1 deletion orchestrator/cli/utils/output/dataframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def df_to_output(
df: "pd.DataFrame",
output_format: Literal["console", "json", "csv"],
file_name: str | None = None,
no_trunc: bool = False,
) -> None:
if output_format != "console" and not file_name:
console_print(
Expand All @@ -43,7 +44,11 @@ def df_to_output(
if output_format == "console":
console_print(
dataframe_to_rich_table(
df, show_edge=True, show_index=True, box=rich.box.SQUARE
df,
show_edge=True,
show_index=True,
box=rich.box.SQUARE,
do_not_truncate_column_content=no_trunc,
)
)
if (
Expand Down
13 changes: 11 additions & 2 deletions orchestrator/cli/utils/resources/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ def handle_ado_get_default_format(

console_print(
dataframe_to_rich_table(
output_df, box=rich.box.SQUARE, show_index=True, show_edge=True
output_df,
box=rich.box.SQUARE,
show_index=True,
show_edge=True,
do_not_truncate_column_content=parameters.no_trunc,
)
)
return
Expand All @@ -154,7 +158,12 @@ def handle_ado_get_default_format(
)

console_print(
dataframe_to_rich_table(output_df, box=rich.box.SQUARE, show_edge=True)
dataframe_to_rich_table(
output_df,
box=rich.box.SQUARE,
show_edge=True,
do_not_truncate_column_content=parameters.no_trunc,
)
)


Expand Down
Loading
Loading