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
2 changes: 1 addition & 1 deletion chuck_data/commands/add_stitch_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="add-stitch-report",
name="add_stitch_report",
description="Create a Stitch report notebook for a unified table",
handler=handle_command,
parameters={
Expand Down
36 changes: 18 additions & 18 deletions chuck_data/commands/bulk_tag_pii.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def handle_bulk_tag_pii(client, **kwargs):
except Exception as e:
# Always cleanup context on any error
context = InteractiveContext()
context.clear_active_context("bulk-tag-pii")
context.clear_active_context("bulk_tag_pii")
return CommandResult(False, error=e, message=f"Error: {str(e)}")


Expand Down Expand Up @@ -482,7 +482,7 @@ def _report_progress(step_message, tool_output_callback=None):
"""Report progress for both agent integration and direct TUI usage."""
if tool_output_callback:
# Agent usage - report via callback
tool_output_callback("bulk-tag-pii", {"step": step_message})
tool_output_callback("bulk_tag_pii", {"step": step_message})
else:
# Direct TUI usage - show progress using console like scan-pii
console = get_console()
Expand Down Expand Up @@ -541,12 +541,12 @@ def _start_interactive_mode(client, **kwargs):

# Store context for interactive workflow
context = InteractiveContext()
context.set_active_context("bulk-tag-pii")
context.store_context_data("bulk-tag-pii", "phase", "review")
context.store_context_data("bulk-tag-pii", "catalog_name", catalog_name)
context.store_context_data("bulk-tag-pii", "schema_name", schema_name)
context.store_context_data("bulk-tag-pii", "scan_summary", scan_summary_data)
context.store_context_data("bulk-tag-pii", "original_kwargs", kwargs)
context.set_active_context("bulk_tag_pii")
context.store_context_data("bulk_tag_pii", "phase", "review")
context.store_context_data("bulk_tag_pii", "catalog_name", catalog_name)
context.store_context_data("bulk_tag_pii", "schema_name", schema_name)
context.store_context_data("bulk_tag_pii", "scan_summary", scan_summary_data)
context.store_context_data("bulk_tag_pii", "original_kwargs", kwargs)

# Display the formatted preview like stitch setup
console = get_console()
Expand Down Expand Up @@ -578,7 +578,7 @@ def _start_interactive_mode(client, **kwargs):
except Exception as e:
# Cleanup context on error
context = InteractiveContext()
context.clear_active_context("bulk-tag-pii")
context.clear_active_context("bulk_tag_pii")
return CommandResult(
False, message=f"Error during interactive mode setup: {str(e)}"
)
Expand All @@ -590,15 +590,15 @@ def _handle_interactive_input(client, user_input, **kwargs):
context = InteractiveContext()
if (
not context.is_in_interactive_mode()
or context.current_command != "bulk-tag-pii"
or context.current_command != "bulk_tag_pii"
):
return CommandResult(
False,
message="No active bulk-tag-pii session found. Please restart the command.",
)

# Extract context data
context_data = context.get_context_data("bulk-tag-pii")
context_data = context.get_context_data("bulk_tag_pii")
tool_output_callback = kwargs.get("tool_output_callback")
console = get_console()

Expand All @@ -622,7 +622,7 @@ def _handle_interactive_input(client, user_input, **kwargs):
# Check for cancel commands (same as stitch)
elif user_input_lower in ["cancel", "abort", "stop", "exit", "quit", "no"]:
# Cancel and cleanup
context.clear_active_context("bulk-tag-pii")
context.clear_active_context("bulk_tag_pii")
console.print(f"\n[{INFO_STYLE}]Bulk PII tagging cancelled.[/{INFO_STYLE}]")
return CommandResult(True, message="Bulk PII tagging cancelled.")

Expand All @@ -643,7 +643,7 @@ def _handle_interactive_input(client, user_input, **kwargs):

except Exception as e:
# Cleanup context on error
context.clear_active_context("bulk-tag-pii")
context.clear_active_context("bulk_tag_pii")
return CommandResult(
False, message=f"Error during interactive input handling: {str(e)}"
)
Expand All @@ -657,7 +657,7 @@ def _proceed_with_tagging(client, context_data, tool_output_callback):

# Clear context since we're proceeding
context = InteractiveContext()
context.clear_active_context("bulk-tag-pii")
context.clear_active_context("bulk_tag_pii")

try:
# Get updated statistics after any exclusions
Expand Down Expand Up @@ -793,10 +793,10 @@ def _exclude_table(context, context_data, table_name):
scan_summary["excluded_tables_count"] = excluded_tables_count

# Update context with new scan summary
context.store_context_data("bulk-tag-pii", "scan_summary", scan_summary)
context.store_context_data("bulk_tag_pii", "scan_summary", scan_summary)

if remaining_tables_with_pii == 0:
context.clear_active_context("bulk-tag-pii")
context.clear_active_context("bulk_tag_pii")
return CommandResult(
True,
message=f"Table '{table_name}' excluded. No PII tables remaining - nothing to tag.",
Expand Down Expand Up @@ -855,7 +855,7 @@ def _handle_modification_request(context, context_data, user_input, console):

# Update stored scan summary
updated_scan_summary = modify_result["scan_summary"]
context.store_context_data("bulk-tag-pii", "scan_summary", updated_scan_summary)
context.store_context_data("bulk_tag_pii", "scan_summary", updated_scan_summary)

console.print(f"\n[{SUCCESS_STYLE}]Configuration updated![/{SUCCESS_STYLE}]")
if modify_result.get("modification_summary"):
Expand Down Expand Up @@ -1200,7 +1200,7 @@ def _helper_modify_pii_config(scan_summary, user_request, llm_client):


DEFINITION = CommandDefinition(
name="bulk-tag-pii",
name="bulk_tag_pii",
description="Scan schema for PII columns and bulk tag them with semantic tags after interactive confirmation",
handler=handle_bulk_tag_pii,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/catalog_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def handle_command(client: Optional[DatabricksAPIClient], **kwargs) -> CommandRe


DEFINITION = CommandDefinition(
name="select-catalog",
name="select_catalog",
description="Set the active catalog for operations by name with fuzzy matching",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/create_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="create-volume",
name="create_volume",
description="Create a new volume in Unity Catalog.",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/create_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="create-warehouse",
name="create_warehouse",
description="Create a new SQL warehouse in the Databricks workspace.",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def handle_command(client: Optional[DatabricksAPIClient], **kwargs) -> CommandRe


DEFINITION = CommandDefinition(
name="getting-started",
name="getting_started",
description="Display helpful tips and examples for using Chuck",
handler=handle_command,
parameters={},
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/job_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="job-status",
name="job_status",
description="Check status of a Chuck job via backend or Databricks. "
"If no parameters provided, uses the last cached job ID.",
handler=handle_command,
Expand Down
4 changes: 2 additions & 2 deletions chuck_data/commands/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def handle_job_status(client: Optional[DatabricksAPIClient], **kwargs) -> Comman


LAUNCH_JOB_DEFINITION = CommandDefinition(
name="launch-job",
name="launch_job",
description="Launch a Databricks job using a config file",
usage_hint="launch_job --config_path=/path/to/config.json --init_script_path=/init/script.sh",
parameters={
Expand All @@ -136,7 +136,7 @@ def handle_job_status(client: Optional[DatabricksAPIClient], **kwargs) -> Comman
)

JOB_STATUS_DEFINITION = CommandDefinition(
name="job-status",
name="job_status",
description="Get the status of a Databricks job run",
usage_hint="job_status --run_id=123456",
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/list_catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="list-catalogs",
name="list_catalogs",
description="Lists all catalogs in the current workspace. By default returns data without showing table. Use display=true when user asks to see catalogs.",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/list_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def handle_command(client: Optional[DatabricksAPIClient], **kwargs) -> CommandRe


DEFINITION = CommandDefinition(
name="list-models",
name="list_models",
description="List available language models from the LLM provider (by default, only shows models with tool calling support)",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/list_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="list-schemas",
name="list_schemas",
description="Lists all schemas in the current catalog. By default returns data without showing table. Use display=true when user asks to see schemas.",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/list_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="list-tables",
name="list_tables",
description="List tables in a Unity Catalog schema. By default returns data without showing table. Use display=true when user asks to see tables.",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/list_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="list-volumes",
name="list_volumes",
description="List volumes in a Unity Catalog schema.",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/list_warehouses.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="list-warehouses",
name="list_warehouses",
description="Lists all SQL warehouses in the current Databricks workspace. By default returns data without showing table. Use display=true when user asks to see warehouses.",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/model_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def handle_command(client: Optional[DatabricksAPIClient], **kwargs) -> CommandRe


DEFINITION = CommandDefinition(
name="select-model",
name="select_model",
description="Set the active model for agent operations",
handler=handle_command,
parameters={
Expand Down
6 changes: 3 additions & 3 deletions chuck_data/commands/monitor_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _monitor_job_completion(
record_count = job_data.get("record-count", 0)

if normalized_state in ["succeeded", "success"]:
success_msg = f"Job completed successfully!"
success_msg = "Job completed successfully!"
if record_count:
success_msg += f" Records: {record_count:,}"
console.print(f"[{SUCCESS_STYLE}]{success_msg}[/{SUCCESS_STYLE}]")
Expand Down Expand Up @@ -369,7 +369,7 @@ def handle_command(
):
return CommandResult(
False,
message=f"Authentication failed. Please authenticate using: chuck auth",
message="Authentication failed. Please authenticate using: chuck auth",
error=e,
)
else:
Expand Down Expand Up @@ -412,7 +412,7 @@ def handle_command(


DEFINITION = CommandDefinition(
name="monitor-job",
name="monitor_job",
description="Monitor a Chuck job with real-time progress updates until completion. "
"Provide either --job-id OR --run-id (not both), or omit both to monitor the last launched job.",
handler=handle_command,
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/run_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def _format_paginated_results_for_agent(result: CommandResult) -> Dict[str, Any]


DEFINITION = CommandDefinition(
name="run-sql",
name="run_sql",
description="Execute a SQL query on a Databricks SQL warehouse.",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/scan_pii.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def handle_command(client: Optional[DatabricksAPIClient], **kwargs) -> CommandRe


DEFINITION = CommandDefinition(
name="scan-schema-for-pii",
name="scan_schema_for_pii",
description="Scan all tables in the current schema (or specified catalog/schema) for PII and/or customer data",
handler=handle_command,
parameters={
Expand Down
2 changes: 1 addition & 1 deletion chuck_data/commands/schema_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def handle_command(client: Optional[DatabricksAPIClient], **kwargs) -> CommandRe


DEFINITION = CommandDefinition(
name="select-schema",
name="select_schema",
description="Set the active schema for operations by name with fuzzy matching",
handler=handle_command,
parameters={
Expand Down
Loading