Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
chore: update examples to replace deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
IndexSeek committed Jul 7, 2024
1 parent 0b4cbc3 commit 08f6c59
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/campaign-finance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
" \"E\": \"recount\",\n",
" }\n",
" first_letter = pgi[0]\n",
" return first_letter.substitute(election_types, else_=ibis.NA)\n",
" return first_letter.substitute(election_types, else_=ibis.null())\n",
"\n",
"\n",
"cleaned = cleaned.mutate(election_type=get_election_type(_.TRANSACTION_PGI)).drop(\n",
Expand Down
26 changes: 13 additions & 13 deletions examples/imdb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To ensure column names are Pythonic, we can relabel as `snake_case`."
"To ensure column names are Pythonic, we can rename as `snake_case`."
]
},
{
Expand All @@ -102,15 +102,15 @@
"metadata": {},
"outputs": [],
"source": [
"name_basics.relabel(\"snake_case\")"
"name_basics.rename(\"snake_case\")"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's grab all of the relevant IMDB tables and relabel columns."
"Let's grab all of the relevant IMDB tables and rename columns."
]
},
{
Expand All @@ -119,13 +119,13 @@
"metadata": {},
"outputs": [],
"source": [
"name_basics = ex.imdb_name_basics.fetch().relabel(\"snake_case\")\n",
"title_akas = ex.imdb_title_akas.fetch().relabel(\"snake_case\")\n",
"title_basics = ex.imdb_title_basics.fetch().relabel(\"snake_case\")\n",
"title_crew = ex.imdb_title_crew.fetch().relabel(\"snake_case\")\n",
"title_episode = ex.imdb_title_episode.fetch().relabel(\"snake_case\")\n",
"title_principals = ex.imdb_title_principals.fetch().relabel(\"snake_case\")\n",
"title_ratings = ex.imdb_title_ratings.fetch().relabel(\"snake_case\")"
"name_basics = ex.imdb_name_basics.fetch().rename(\"snake_case\")\n",
"title_akas = ex.imdb_title_akas.fetch().rename(\"snake_case\")\n",
"title_basics = ex.imdb_title_basics.fetch().rename(\"snake_case\")\n",
"title_crew = ex.imdb_title_crew.fetch().rename(\"snake_case\")\n",
"title_episode = ex.imdb_title_episode.fetch().rename(\"snake_case\")\n",
"title_principals = ex.imdb_title_principals.fetch().rename(\"snake_case\")\n",
"title_ratings = ex.imdb_title_ratings.fetch().rename(\"snake_case\")"
]
},
{
Expand Down Expand Up @@ -420,7 +420,7 @@
"metadata": {},
"outputs": [],
"source": [
"ibis.show_sql(name_basics)"
"ibis.to_sql(name_basics)"
]
},
{
Expand All @@ -437,8 +437,8 @@
"metadata": {},
"outputs": [],
"source": [
"title_akas = title_akas.mutate(title_id=tconst_to_int(_.title_id)).relabel(\n",
" {\"title_id\": \"tconst\"}\n",
"title_akas = title_akas.mutate(title_id=tconst_to_int(_.title_id)).rename(\n",
" {\"tconst\": \"title_id\"}\n",
")\n",
"title_basics = title_basics.mutate(tconst=tconst_to_int(_.tconst))\n",
"title_crew = title_crew.mutate(\n",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ jupyterlab == 3.4.8
ipywidgets
altair
pandas < 2.1
ibis-framework[sqlite,duckdb,clickhouse]
ibis-framework[sqlite,duckdb,clickhouse,examples]
ibis-substrait < 3.1

0 comments on commit 08f6c59

Please sign in to comment.