Skip to content

Conversation

@aviatco
Copy link
Collaborator

@aviatco aviatco commented Dec 9, 2025

📥 Pull Request

✨ Description of new changes

Update create command Output Format and Add Batch output processing

Overview

Enhanced the create command output format to include API response data and implemented batch output for operations that create multiple items in a single command execution.

Key Changes

  1. Enhanced Output Format with API Response Data
    Updated print_output_format calls: Modified all mkdir command implementations to include API response data in the output
    Added show_headers=True: Enabled structured table headers for better readability
    Consistent data inclusion: All mkdir operations now return the complete API response alongside success messages
    Files Modified:
  2. Implemented Batch output for Multiple Item Creation
    Batch collection mechanism: Added output_batch tracking system for operations creating multiple items
    Consolidated output: Multiple related item creations now produce unified output instead of separate messages
    Dependency handling: Automatic dependencies (like EventHouse for KQL Database) are batched together
    Key Implementation Details:
    Consolidated messaging: Multiple items show as 'item1.Type' and 'item2.Type' created
  3. Enhanced Output Structure
    API response inclusion: Full API response data now included in output for debugging/automation
    Table formatting: Structured headers show item properties (id, type, displayName, workspaceId)
    JSON/Text format support: Both output formats include the enhanced data structure
    Benefits
    For Users
    Better visibility: Users can see complete API response data including IDs, types, and metadata
    Cleaner output: Related operations (like KQL Database + EventHouse) show consolidated results
    Structured information: Table headers make it easier to understand response data
    For Automation
    Rich data access: Scripts can access full API response data for further processing
    Consistent format: Standardized output structure across all mkdir operations
    Batch awareness: Automated tools can detect when multiple items were created together

Testing

Comprehensive test coverage: Tests verify both single item and batch creation scenarios
Output validation: Tests confirm proper headers, data inclusion, and message formatting
Format compatibility: Both JSON and text output formats tested with new structure

Example Output Changes

Before:

  • 'MyLakehouse.Lakehouse' created

After (Text format):

id type displayName workspaceId

12345678-1234-1234-1234-123456789012 Lakehouse MyLakehouse abcd-efgh-ijkl

  • 'MyLakehouse.Lakehouse' created

Batch Example (KQL Database with auto EventHouse):

id type displayName workspaceId

87654321-4321-4321-4321-876543210987 Eventhouse MyDatabase_auto abcd-efgh-ijkl
12345678-1234-1234-1234-123456789012 KQLDatabase MyDatabase abcd-efgh-ijkl

  • 'MyDatabase_auto.Eventhouse' and 'MyDatabase.KQLDatabase' created

This enhancement provides richer output information while maintaining backward compatibility and improving the user experience for both interactive use and automation scenarios.

@aviatco aviatco marked this pull request as ready for review December 9, 2025 14:14
@aviatco aviatco requested a review from a team as a code owner December 9, 2025 14:14
@aviatco aviatco changed the title Add api response in the result for JSON format feat: Add api response in the result for JSON format Dec 9, 2025
@aviatco aviatco changed the title feat: Add api response in the result for JSON format feat [output format]: Add api response in the result for JSON format Dec 9, 2025
@aviatco aviatco changed the title feat [output format]: Add api response in the result for JSON format feat[output format]: Add api response in the result for JSON format Dec 9, 2025
@ayeshurun ayeshurun changed the title feat[output format]: Add api response in the result for JSON format feat(output format): Add api response in the result for JSON format Dec 9, 2025
Co-authored-by: Alon Yeshurun <98805507+ayeshurun@users.noreply.github.com>
ayeshurun
ayeshurun previously approved these changes Dec 22, 2025
Copy link
Collaborator

@ayeshurun ayeshurun left a comment

Choose a reason for hiding this comment

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

Consider adding docstrings for better readability and clarity

ayeshurun
ayeshurun previously approved these changes Dec 23, 2025
Copy link
Collaborator

@ayeshurun ayeshurun left a comment

Choose a reason for hiding this comment

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

Minor suggestion.

@aviatco aviatco merged commit 0857c8b into microsoft:main Dec 24, 2025
9 checks passed
@aviatco aviatco changed the title feat(output format): Add api response in the result for JSON format feat(output format): Add api response in the result for JSON format - create command Dec 24, 2025
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.

2 participants