-
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try pandera: add jupyterlite notebooks, add support for py3.7 (#951)
* add jupyterlite to docs * handle test errors * add jupyterlite_sphinx to deps * exclude 3.7 from docs build
- Loading branch information
1 parent
dc6b39c
commit 1bcfe01
Showing
17 changed files
with
217 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"LiteBuildConfig": { | ||
"federated_extensions": [ | ||
"https://conda.anaconda.org/conda-forge/noarch/pandera-0.12.0-hd8ed1ab_0.tar.bz2", | ||
], | ||
"ignore_sys_prefix": true, | ||
"piplite_urls": [ | ||
"https://files.pythonhosted.org/packages/95/cc/e058935b0b34d50214596297f0a9edb0781fc5201bf2c6eb8cf1a026d710/pandera-0.12.0-py3-none-any.whl", | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ac4294bb", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import piplite\n", | ||
"\n", | ||
"\n", | ||
"for package in [\n", | ||
" \"wrapt\",\n", | ||
" \"typing_extensions\",\n", | ||
" \"mypy_extensions\",\n", | ||
" \"typing_inspect\",\n", | ||
" \"pydantic\",\n", | ||
" \"pandera\",\n", | ||
"]:\n", | ||
" await piplite.install(package, deps=False)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "c9a4eef5", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd\n", | ||
"import pandera as pa\n", | ||
"from pandera.typing import DataFrame, Series\n", | ||
"\n", | ||
"\n", | ||
"class Schema(pa.SchemaModel):\n", | ||
" item: Series[str] = pa.Field(isin=[\"apple\", \"orange\"], coerce=True)\n", | ||
" price: Series[float] = pa.Field(gt=0)\n", | ||
"\n", | ||
"\n", | ||
"@pa.check_types(lazy=True)\n", | ||
"def transform_data(data: DataFrame[Schema]):\n", | ||
" ...\n", | ||
"\n", | ||
"\n", | ||
"data = pd.DataFrame.from_records([\n", | ||
" {\"item\": \"applee\", \"price\": 0.5},\n", | ||
" {\"item\": \"orange\", \"price\": -1000}\n", | ||
"])\n", | ||
"\n", | ||
"\n", | ||
"try:\n", | ||
" transform_data(data)\n", | ||
"except pa.errors.SchemaErrors as exc:\n", | ||
" display(exc.failure_cases)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.7" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Try Pandera | ||
=============== | ||
|
||
In the notebook below, you can get a sense of how to use pandera right in the | ||
browser without having to install anything locally! | ||
|
||
.. retrolite:: notebooks/try_pandera.ipynb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.