Forum Discussion
Data ingesting from API to Lakehouse, file format wrong, how to resolve?
- 4 months ago
hi ayyappa5678220
This is a common problem when copying ZIP files via pipeline without extracting them, or when the file lands without a proper extension.
give this a try
In your Fabric Pipeline, after the Copy Data activity, add a Notebook activity to unzip and load the files:import zipfile, os, shutil
src="/lakehouse/default/Files/data/efa0b651-c7d4-4282-92fc-21c3e11464a2"
dest = "/lakehouse/default/Files/data/extracted/"os.makedirs(dest, exist_ok=True)
if zipfile.is_zipfile(src):
with zipfile.ZipFile(src, 'r') as z:
z.extractall(dest)
print("Extracted:", z.namelist())
hi ayyappa5678220
This is a common problem when copying ZIP files via pipeline without extracting them, or when the file lands without a proper extension.
give this a try
In your Fabric Pipeline, after the Copy Data activity, add a Notebook activity to unzip and load the files:
import zipfile, os, shutil
src="/lakehouse/default/Files/data/efa0b651-c7d4-4282-92fc-21c3e11464a2"
dest = "/lakehouse/default/Files/data/extracted/"
os.makedirs(dest, exist_ok=True)
if zipfile.is_zipfile(src):
with zipfile.ZipFile(src, 'r') as z:
z.extractall(dest)
print("Extracted:", z.namelist())