feat: support import & export Lakehouse#202
feat: support import & export Lakehouse#202v-alexmoraru wants to merge 3 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
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 exportandfs importsupport forlakehouseviacommand_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. |
| 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(): |
There was a problem hiding this comment.
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".
Uh oh!
There was an error while loading. Please reload this page.