Skip to content

Add lakehouse Delta table detail APIs and over-partitioned table reporting - #1251

Draft
m-kovalsky with Copilot wants to merge 3 commits into
mainfrom
copilot/add-delta-table-details-function
Draft

Add lakehouse Delta table detail APIs and over-partitioned table reporting#1251
m-kovalsky with Copilot wants to merge 3 commits into
mainfrom
copilot/add-delta-table-details-function

Conversation

Copilot AI commented May 26, 2026

Copy link
Copy Markdown
Contributor

This change adds first-class lakehouse APIs to surface Delta table size, file count, and partition metadata, and introduces a lakehouse-wide report for detecting over-partitioned tables. It addresses the need to quickly identify tables that may require partitioning/optimization adjustments using practical size thresholds.

  • New Delta table detail API

    • Added get_delta_table_details(...) in sempy_labs.lakehouse._partitioning.
    • Returns table-level metadata needed for partition diagnostics:
      • Size In Bytes, Size In GB, Files
      • Partition Columns, Is Partitioned
      • Table Name, Schema Name
  • New over-partitioning report API

    • Added list_over_partitioned_tables(...) to scan Delta tables in a lakehouse and return only those that breach thresholds.
    • Uses the requested heuristics:
      • total table size < 1 TB (default 1000 GB), or
      • average partition size < 1 GB.
  • Partitioning logic consolidation

    • Refactored is_over_partitioned(...) to reuse shared detail-based evaluation logic.
    • Introduced shared constants for detail schema/typing to keep report output consistent, including empty results.
  • Public lakehouse surface update

    • Exported partitioning/detail functions via sempy_labs.lakehouse:
      • is_partitioned
      • list_partitioned_columns
      • get_delta_table_details
      • is_over_partitioned
      • list_over_partitioned_tables
import sempy_labs.lakehouse as lakehouse

details = lakehouse.get_delta_table_details(
    table="fact_sales",
    schema="dbo",
    lakehouse="ContosoLakehouse",
    workspace="Finance"
)

over_partitioned = lakehouse.list_over_partitioned_tables(
    lakehouse="ContosoLakehouse",
    workspace="Finance",
    total_table_size_gb=1000,
    average_partition_size_gb=1
)

Copilot AI changed the title [WIP] Add function to return Delta table size and partition details Add lakehouse Delta table detail APIs and over-partitioned table reporting May 26, 2026
Copilot AI requested a review from m-kovalsky May 26, 2026 21:40
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.

Get Delta table details such as size, partition

2 participants