Freigeben über


Definition des Notizbuchs

Dieser Artikel enthält eine Aufschlüsselung der Definitionsstruktur für Notizbuchelemente.

Unterstützte Formate

Notizbuchelemente unterstützen FabricGitSource und ipynb formatieren. Wenn kein Format angegeben ist, wird es standardmäßig auf FabricGitSource.

Hinweis

Das FabricGitSource Format gibt den Notizbuchinhalt im Dateiformat zurück, das der ausgewählten Sprache entspricht. Wenn beispielsweise PySpark ausgewählt ist, wird der Inhalt als .py Datei zurückgegeben.

Definitionsteile

Die Definition eines Notizbuchelements besteht aus einem einzelnen Teil und wird wie folgt erstellt:

  • Pfad : Der Dateiname, z. B artifact.content.ipynb. .

    • für PySpark oder Python: notebook-content.py
    • für Spark SQL: notebook-content.sql
    • für Spark (Scala): notebook-content.scala
    • für SparkR (R): notebook-content.r
  • Nutzlasttyp - InlineBase64

  • Payload- Siehe: Beispiel für Nutzlastinhalte, die von Base64-decodiert wurden.

Plattformpart

Der Plattformteil ist eine Datei, die die Metadateninformationen des Notizbuchs enthält.

  • Create Item with definition respects the platform file if provided. (Plattform nicht verpflichtend).

  • Definition Element abrufen gibt immer die Plattformdatei zurück.

  • Element aktualisieren Definition akzeptiert die Plattformdatei, sofern angegeben, jedoch nur, wenn Sie einen neuen URL-Parameter updateMetadata=truefestlegen.

Beispiel für ipynb-Format nutzlastinhalt decodiert von 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"
        }
    }
}

Definitionsbeispiel für ipynb

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

Beispiel für Fabric Git-Ressourcenformat-Nutzlastinhalt, decodiert von 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 } 

Definitionsbeispiel für fabricGitSource

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