microsoft / semantic-link-labs

Early access to new features for Microsoft Fabric's Semantic Link.
MIT License
178 stars 37 forks source link

Function to restore blob after unintended deletion from OneLake #123

Open jugi92 opened 2 months ago

jugi92 commented 2 months ago

Is your feature request related to a problem? Please describe. When deleting a File in a Lakehouse Folder unintentionally it should be possible to restore it via a simple python command. The data should still be avalailable because OneLake works with softdelete for 7 days.

Describe the solution you'd like

  1. I would like to see a function like restore_deleted_file_from_onelake(path="Files/bronze/datasource1/data.csv")

Describe alternatives you've considered Restoring individual files currently works with the use of powershell for restoring the data, but that is much more complicated than running a notebook in the Fabric Web UI.

Additional context This function could be the basis for a future restore concept for a Lakehouse. The users would need to store the folder structures and the paths to the Delta Log files (e.g. /Tables/table_name/_delta_log/00000000000000000000.json

With that information it should be possible to restore the delta log file and that json file contains the paths for the individual parquet files with the data (e.g. /Tables/table_name/part-00000-22e5716c-23e3-44fe-90ee-a9a858a5c10c-c000.snappy.parquet). After restoring those the tables should be completely restored.

jugi92 commented 2 months ago

start of the work: https://github.com/jugi92/Fabric_bcdr/blob/main/Restore_Deleted_Files_From_Warehouse.ipynb