Notebookdefinitie

Dit artikel bevat een uitsplitsing van de definitiestructuur voor notitieblokitems.

Ondersteunde indelingen

Notitieblokitems ondersteunen FabricGitSource en ipynb opmaken. Als er geen indeling is opgegeven, wordt deze standaard ingesteld op FabricGitSource.

Opmerking

De FabricGitSource indeling retourneert notitieblokinhoud in de bestandsindeling die overeenkomt met de geselecteerde taal. Als PySpark bijvoorbeeld is geselecteerd, wordt de inhoud geretourneerd als een .py bestand.

Definitieonderdelen

De definitie van een notitieblokitem bestaat uit één onderdeel en wordt als volgt samengesteld:

  • Pad : de bestandsnaam, bijvoorbeeld artifact.content.ipynb.

    • voor PySpark of Python: notebook-content.py
    • voor Spark SQL: notebook-content.sql
    • voor Spark (Scala): notebook-content.scala
    • voor SparkR (R): notebook-content.r
  • Payload-type - InlineBase64

  • Payload Zie: Voorbeeld van inhoud van nettolading die is gedecodeerd uit Base64.

Platformonderdeel

Het platformonderdeel is een bestand dat de metagegevensinformatie van het notebook bevat.

  • Item maken met definitie respecteert het platformbestand indien opgegeven. (Platform is niet verplicht).

  • definitie Item ophalen retourneert altijd het platformbestand.

  • definitie item bijwerken accepteert het platformbestand indien opgegeven, maar alleen als u een nieuwe URL-parameter instelt updateMetadata=true.

Voorbeeld van inhoud van de nettolading van de ipynb-indeling die is gedecodeerd vanuit Base64

{
    "nbformat": 4,
    "nbformat_minor": 5,
    "cells": [
        {
            "cell_type": "code",
            "source": ["# Welcome to your new notebook\n# Type here in the cell editor to add code!\n"],
            "execution_count": null,
            "outputs": [],
            "metadata": {}
        }
    ],
    "metadata": {
        "language_info": {
            "name": "python"
        }
    }
}

Definitievoorbeeld voor ipynb

{
    "format": "ipynb",
    "parts": [
        {
            "path": "artifact.content.ipynb",
            "payload": "eyJuYmZvcm1hdCI6NCwibmJmb3JtYXR_fbWlub3IiOjUsImNlbGxzIjpbeyJjZWxsX3R5cGUiOiJjb2RlIiwic291cmNlIjpbIiMgV2VsY29tZSB0byB5b3VyIG5ldyBub3RlYm9va1xuIyBUeXBlIGhlcmUgaW4gdGhlIGNlbGwgZWRpdG9yIHRvIGFkZCBjb2RlIVxuIl0sImV4ZWN1dGlvbl9jb3VudCI6bnVsbCwib3V0cHV0cyI6W10sIm1ldGFkYXRhIjp7fX1dLCJtZXRhZGF0YSI6eyJsYW5ndWFnZV9pbmZvIjp7Im5hbWUiOiJweXRob24ifX19",
            "payloadType": "InlineBase64"
        },
        {
            "path": ".platform",
            "payload": "ZG90UGxhdGZvcm1CYXNlNjRTdHJpbmc=",
            "payloadType": "InlineBase64"
        }
    ]
}

Voorbeeld van nettoladinginhoud voor git-resource-indeling van infrastructuur die is gedecodeerd vanuit Base64

# Fabric notebook source 
# METADATA ******************** 
# META { 
# META   "kernel_info": { 
# META     "name": "synapse_pyspark" 
# META   }, 
# META   "dependencies": {} 
# META } 
# CELL ******************** 
# Welcome to your new notebook 
# Type here in the cell editor to add code! 
# METADATA ******************** 
# META { 
# META   "language": "python", 
# META   "language_group": "synapse_pyspark" 
# META } 

Definitievoorbeeld voor fabricGitSource

{
    "format": "fabricGitSource",
    "parts": [
        {
            "path": "notebook-content.py",
            "payload": "ewogICIkc2NoZW1hIjogImh0dHBzOi8vZGV2ZWxvcGVyLm1pY3Jvc29mdC5jb20vanNvbi1zY2hlbWFzL2ZhYnJpYy9naXRJbnRlZ3JhdGlvbi9wbGF0Zm9ybVByb3BlcnRpZXMvMi4wLjAvc2NoZW1hLmpzb24iLAogICJtZXRhZGF0YSI6IHsKICAgICJ0eXBlIjogIk5vdGVib29rIiwKICAgICJkaXNwbGF5TmFtZSI6ICJOb3RlYm9vayA4IiwKICAgICJkZXNjcmlwdGlvbiI6ICJOZXcgbm90ZWJvb2siCiAgfSwKICAiY29uZmlnIjogewogICAgInZlcnNpb24iOiAiMi4wIiwKICAgICJsb2dpY2FsSWQiOiAiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIgogIH0KfQ==",
            "payloadType": "InlineBase64"
        },
        {
            "path": ".platform",
            "payload": "ZG90UGxhdGZvcm1CYXNlNjRTdHJpbmc=",
            "payloadType": "InlineBase64"
        }
    ]
}