Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nanne-aben committed Aug 30, 2023
1 parent 037c1bf commit 69779b8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions docs/source/dataset_implements.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -86,7 +86,7 @@
" df,\n",
" df.typedspark_schema,\n",
" {Person.age: Person.age + 1},\n",
" )\n"
" )"
]
},
{
Expand Down Expand Up @@ -123,7 +123,7 @@
" df,\n",
" df.typedspark_schema,\n",
" {Age.age: Age.age + 1},\n",
" )\n"
" )"
]
},
{
Expand All @@ -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"
]
},
{
Expand Down

0 comments on commit 69779b8

Please sign in to comment.