Skip to content

feat: support import & export Lakehouse#202

Open
v-alexmoraru wants to merge 3 commits intomicrosoft:mainfrom
v-alexmoraru:dev/v-alexmoraru/support-lakehouse-import-export
Open

feat: support import & export Lakehouse#202
v-alexmoraru wants to merge 3 commits intomicrosoft:mainfrom
v-alexmoraru:dev/v-alexmoraru/support-lakehouse-import-export

Conversation

@v-alexmoraru
Copy link
Copy Markdown
Member

@v-alexmoraru v-alexmoraru commented Mar 26, 2026

@v-alexmoraru v-alexmoraru requested a review from a team as a code owner March 26, 2026 08:30
Copilot AI review requested due to automatic review settings April 3, 2026 07:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Microsoft Fabric Lakehouse support to the CLI’s existing item-definition import/export flow (Fixes #106), aligning Lakehouse behavior with other definition-capable item types.

Changes:

  • Enable fs export and fs import support for lakehouse via command_support.yaml.
  • Remove the hard-coded “Import from Lakehouse/Files not supported” guard in the import implementation.
  • Extend test coverage and VCR recordings to include Lakehouse import/export scenarios (success + invalid format cases), and add a changelog entry.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/fabric_cli/core/fab_config/command_support.yaml Adds lakehouse to supported item types for import/export.
src/fabric_cli/commands/fs/impor/fab_fs_import_item.py Removes the Lakehouse/Files import restriction in the import path handling.
tests/test_commands/conftest.py Expands parameterized command test matrices to include ItemType.LAKEHOUSE for import/export and format validation.
tests/test_commands/test_export.py Updates assertions to account for Lakehouse exports producing more definition parts/files.
tests/test_commands/test_import.py Adds Lakehouse to invalid-format coverage expectations.
tests/test_utils/test_fab_item_util.py Adjusts unit test setup to use a truly non-exportable item type now that Lakehouse is exportable.
tests/test_commands/recordings/test_commands/test_import/test_import_create_new_item_success[Lakehouse].yaml New VCR cassette for successful Lakehouse import (create).
tests/test_commands/recordings/test_commands/test_import/test_import_update_existing_item_success[Lakehouse].yaml New VCR cassette for successful Lakehouse import (update).
tests/test_commands/recordings/test_commands/test_import/test_import_item_wrong_format_fail[Lakehouse].yaml New VCR cassette for Lakehouse invalid-format import failure.
tests/test_commands/recordings/test_commands/test_import/class_setup.yaml Updates import test class setup recording after adding Lakehouse scenarios.
tests/test_commands/recordings/test_commands/test_export/test_export_item_success[Lakehouse-.json].yaml New VCR cassette for successful Lakehouse export.
tests/test_commands/recordings/test_commands/test_export/test_export_item_home_directory_path_success[Lakehouse-.json].yaml New VCR cassette for Lakehouse export to ~/... path.
tests/test_commands/recordings/test_commands/test_export/test_export_item_default_format_success[Lakehouse-4].yaml New VCR cassette validating Lakehouse default export produces 4 parts.
tests/test_commands/recordings/test_commands/test_export/test_export_item_invalid_output_path_failure[Lakehouse].yaml New VCR cassette for Lakehouse invalid output path failure.
tests/test_commands/recordings/test_commands/test_export/test_export_item_invalid_format_failure[Lakehouse-.txt].yaml New VCR cassette for Lakehouse invalid format export failure.
tests/test_commands/recordings/test_commands/test_export/class_setup.yaml Updates export test class setup recording after adding Lakehouse scenarios.
.changes/unreleased/added-20260403-104412.yaml Adds changelog entry announcing Lakehouse import/export support.

Comment on lines 25 to 28
args.ws_id = item.workspace.id
input_path = utils_storage.get_import_path(args.input)

# Input path only support from local directories
if input_path["type"] == "lakehouse":
raise FabricCLIError(
"Import from Lakehouse/Files not supported",
fab_constant.ERROR_NOT_SUPPORTED,
)

if args.force or utils_ui.prompt_confirm():
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

utils_storage.get_import_path() can return {type: "lakehouse"} when the user passes a OneLake Files path, but utils_import.get_payload_for_item_type()/_build_definition only supports local directories (it uses os.walk/open). After removing the guard, importing from a Lakehouse/Files path will now produce an empty/invalid definition payload or fail with a filesystem error instead of a clear CLI error. Consider reintroducing an explicit validation that the import input path is local (or add proper OneLake read support) and raise a FabricCLIError with an actionable message when input_path["type"] != "local".

Copilot uses AI. Check for mistakes.
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.

[FEATURE] support item-definition for lakehouse items

2 participants