Skip to content

Commit

Permalink
Add Python 3.12 to ci/cd (#203)
Browse files Browse the repository at this point in the history
* Add Python 3.12 to ci/cd

* update

* update
  • Loading branch information
nanne-aben authored Oct 19, 2023
1 parent 9d7da10 commit 09dc0be
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 89 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -48,4 +48,8 @@ jobs:
coverage report -m --fail-under 100
- name: Run notebooks
run: |
for FILE in docs/*/*.ipynb; do papermill $FILE output.json -k python3; done
for FILE in docs/*/*.ipynb; do
BASE=$(basename $FILE)
cp $FILE .
jupyter nbconvert --to notebook $BASE --execute
done
13 changes: 5 additions & 8 deletions docs/remove_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ def remove_spark_warnings(cell):
continue
if "WARN Utils: Service 'SparkUI' could not bind on port" in output.text:
continue
if (
"FutureWarning: is_datetime64tz_dtype is deprecated and will be removed in a future version." # noqa: E501
in output.text
):
continue
outputs.append(output)

cell.outputs = outputs


def remove_papermill_metadata(nb):
"""Removes the papermill metadata from a notebook."""
if "papermill" in nb.metadata.keys():
nb.metadata.pop("papermill")


if __name__ == "__main__":
FILENAME = sys.argv[1]
nb = nbformat.read(FILENAME, as_version=4)
Expand All @@ -46,6 +45,4 @@ def remove_papermill_metadata(nb):
clear_metadata(nb_cell)
remove_spark_warnings(nb_cell)

remove_papermill_metadata(nb)

nbformat.write(nb, FILENAME)
13 changes: 10 additions & 3 deletions docs/run_notebooks.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
for FILE in docs/*/*.ipynb; do
papermill $FILE $FILE;
python docs/remove_metadata.py $FILE;
for FILE in docs/*/*.ipynb; do
echo "Running $FILE"
DIR=$(dirname $FILE)
BASE=$(basename $FILE)
mv $FILE .

jupyter nbconvert --to notebook $BASE --execute --inplace
python docs/remove_metadata.py $BASE;

mv $BASE $DIR
done
12 changes: 6 additions & 6 deletions docs/source/column_ambiguity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
"+---+----+----+---+------+\n",
"| id|name| age| id|salary|\n",
"+---+----+----+---+------+\n",
"| 1|null|null| 1| null|\n",
"| 2|null|null| 2| null|\n",
"| 3|null|null| 3| null|\n",
"| 1|NULL|NULL| 1| NULL|\n",
"| 2|NULL|NULL| 2| NULL|\n",
"| 3|NULL|NULL| 3| NULL|\n",
"+---+----+----+---+------+\n",
"\n"
]
Expand Down Expand Up @@ -195,9 +195,9 @@
"+---+----+----+------+\n",
"| id|name| age|salary|\n",
"+---+----+----+------+\n",
"| 1|null|null| null|\n",
"| 2|null|null| null|\n",
"| 3|null|null| null|\n",
"| 1|NULL|NULL| NULL|\n",
"| 2|NULL|NULL| NULL|\n",
"| 3|NULL|NULL| NULL|\n",
"+---+----+----+------+\n",
"\n"
]
Expand Down
28 changes: 14 additions & 14 deletions docs/source/create_empty_datasets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"+----+----+----+\n",
"| id|name| age|\n",
"+----+----+----+\n",
"|null|null|null|\n",
"|null|null|null|\n",
"|null|null|null|\n",
"|NULL|NULL|NULL|\n",
"|NULL|NULL|NULL|\n",
"|NULL|NULL|NULL|\n",
"+----+----+----+\n",
"\n"
]
Expand Down Expand Up @@ -77,9 +77,9 @@
"+---+----+----+\n",
"| id|name| age|\n",
"+---+----+----+\n",
"| 1|John|null|\n",
"| 2|Jane|null|\n",
"| 3|Jack|null|\n",
"| 1|John|NULL|\n",
"| 2|Jane|NULL|\n",
"| 3|Jack|NULL|\n",
"+---+----+----+\n",
"\n"
]
Expand Down Expand Up @@ -121,13 +121,13 @@
"+----+-------+---+\n",
"| id| name|age|\n",
"+----+-------+---+\n",
"|null| Alice| 20|\n",
"|null| Bob| 30|\n",
"|null|Charlie| 40|\n",
"|null| Dave| 50|\n",
"|null| Eve| 60|\n",
"|null| Frank| 70|\n",
"|null| Grace| 80|\n",
"|NULL| Alice| 20|\n",
"|NULL| Bob| 30|\n",
"|NULL|Charlie| 40|\n",
"|NULL| Dave| 50|\n",
"|NULL| Eve| 60|\n",
"|NULL| Frank| 70|\n",
"|NULL| Grace| 80|\n",
"+----+-------+---+\n",
"\n"
]
Expand Down Expand Up @@ -229,7 +229,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/generating_schemas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions docs/source/structtype_columns.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@
"+-----------+\n",
"|consequeces|\n",
"+-----------+\n",
"| {null, 1}|\n",
"| {null, 2}|\n",
"| {null, 3}|\n",
"| {NULL, 1}|\n",
"| {NULL, 2}|\n",
"| {NULL, 3}|\n",
"+-----------+\n",
"\n"
]
Expand Down
4 changes: 2 additions & 2 deletions docs/source/structtypes_in_notebooks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@
"+---------+\n",
"| values|\n",
"+---------+\n",
"|{2, null}|\n",
"|{3, null}|\n",
"|{2, NULL}|\n",
"|{3, NULL}|\n",
"+---------+\n",
"\n"
]
Expand Down
10 changes: 5 additions & 5 deletions docs/source/transforming_datasets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Cannot convert column into bool: please use '&' for 'and', '|' for 'or', '~' for 'not' when building DataFrame boolean expressions.\n"
"[CANNOT_CONVERT_COLUMN_INTO_BOOL] Cannot convert column into bool: please use '&' for 'and', '|' for 'or', '~' for 'not' when building DataFrame boolean expressions.\n"
]
}
],
Expand Down Expand Up @@ -171,9 +171,9 @@
"+----+--------+-----------+\n",
"| id|function|hourly_rate|\n",
"+----+--------+-----------+\n",
"|null| null| 26|\n",
"|null| null| 46|\n",
"|null| null| 66|\n",
"|NULL| NULL| 26|\n",
"|NULL| NULL| 46|\n",
"|NULL| NULL| 66|\n",
"+----+--------+-----------+\n",
"\n"
]
Expand Down Expand Up @@ -213,7 +213,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/type_checking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions docs/videos/ide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
},
"orig_nbformat": 4
}
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down
Loading

0 comments on commit 09dc0be

Please sign in to comment.