From 69779b80e76ee4aad50759d8bf9ca06aa75fb1c3 Mon Sep 17 00:00:00 2001 From: nanne-aben <47976799+nanne-aben@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:55:53 +0200 Subject: [PATCH] update --- docs/source/dataset_implements.ipynb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/source/dataset_implements.ipynb b/docs/source/dataset_implements.ipynb index 591ee29..c61bb80 100644 --- a/docs/source/dataset_implements.ipynb +++ b/docs/source/dataset_implements.ipynb @@ -20,7 +20,7 @@ "from pyspark.sql import SparkSession\n", "\n", "spark = SparkSession.Builder().config(\"spark.ui.showConsoleProgress\", \"false\").getOrCreate()\n", - "spark.sparkContext.setLogLevel(\"ERROR\")" + "spark.sparkContext.setLogLevel(\"ERROR\")\n" ] }, { @@ -56,7 +56,7 @@ "\n", "person = create_empty_dataset(spark, Person)\n", "pet = create_empty_dataset(spark, Pet)\n", - "fruit = create_empty_dataset(spark, Fruit)" + "fruit = create_empty_dataset(spark, Fruit)\n" ] }, { @@ -86,7 +86,7 @@ " df,\n", " df.typedspark_schema,\n", " {Person.age: Person.age + 1},\n", - " )\n" + " )" ] }, { @@ -123,7 +123,7 @@ " df,\n", " df.typedspark_schema,\n", " {Age.age: Age.age + 1},\n", - " )\n" + " )" ] }, { @@ -147,15 +147,19 @@ "metadata": {}, "outputs": [], "source": [ - "happy_person = birthday(person) # returns a DataSet[Person]\n", - "happy_pet = birthday(pet) # returns a DataSet[Pet]\n", + "# returns a DataSet[Person]\n", + "happy_person = birthday(person)\n", + "\n", + "# returns a DataSet[Pet]\n", + "happy_pet = birthday(pet)\n", + "\n", "try:\n", " # Raises a linting error:\n", " # Argument of type \"DataSet[Fruit]\" cannot be assigned to\n", " # parameter \"df\" of type \"DataSetImplements[Age, T@birthday]\"\n", " birthday(fruit)\n", "except Exception as e:\n", - " pass" + " pass\n" ] }, {