1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
setuptools-scm,
# dependencies
numpy,
packaging,
pandas,
pydantic,
typeguard,
typing-extensions,
typing-inspect,
# optional-dependencies
black,
dask,
duckdb,
fastapi,
geopandas,
hypothesis,
ibis-framework,
pandas-stubs,
polars,
pyyaml,
scipy,
shapely,
# tests
joblib,
pyarrow-hotfix,
pyarrow,
pytest-asyncio,
pytestCheckHook,
pythonAtLeast,
rich,
}:
buildPythonPackage rec {
pname = "pandera";
version = "0.27.1";
pyproject = true;
src = fetchFromGitHub {
owner = "unionai-oss";
repo = "pandera";
tag = "v${version}";
hash = "sha256-p4oyPlrz+fsAj3PXQnt3HOG48bkWbbG4BVU8pm2P2aU=";
};
build-system = [
setuptools
setuptools-scm
];
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
dependencies = [
packaging
pydantic
typeguard
typing-extensions
typing-inspect
];
optional-dependencies =
let
dask-dataframe = [ dask ] ++ dask.optional-dependencies.dataframe;
extras = {
strategies = [ hypothesis ];
hypotheses = [ scipy ];
io = [
pyyaml
black
#frictionless # not in nixpkgs
];
# pyspark expression does not define optional-dependencies.connect:
#pyspark = [ pyspark ] ++ pyspark.optional-dependencies.connect;
# modin not in nixpkgs:
#modin = [
# modin
# ray
#] ++ dask-dataframe;
#modin-ray = [
# modin
# ray
#];
#modin-dask = [
# modin
#] ++ dask-dataframe;
dask = dask-dataframe;
mypy = [ pandas-stubs ];
fastapi = [ fastapi ];
geopandas = [
geopandas
shapely
];
ibis = [
ibis-framework
duckdb
];
pandas = [
numpy
pandas
];
polars = [ polars ];
};
in
extras // { all = lib.concatLists (lib.attrValues extras); };
nativeCheckInputs = [
joblib
pyarrow
pyarrow-hotfix
pytest-asyncio
pytestCheckHook
rich
]
++ optional-dependencies.all;
disabledTestPaths = [
"tests/fastapi/test_app.py" # tries to access network
"tests/pandas/test_docs_setting_column_widths.py" # tests doc generation, requires sphinx
"tests/modin" # requires modin, not in nixpkgs
"tests/mypy/test_pandas_static_type_checking.py" # some typing failures
"tests/pyspark" # requires spark
# KeyError: 'dask'
"tests/dask/test_dask.py::test_series_schema"
"tests/dask/test_dask_accessor.py::test_dataframe_series_add_schema"
# TypeError: memtable() got an unexpected keyword argument 'name'
# https://github.com/unionai-oss/pandera/issues/2154
"tests/ibis/test_ibis_container.py"
];
disabledTests = [
# TypeError: __class__ assignment: 'GeoDataFrame' object...
"test_schema_model"
"test_schema_from_dataframe"
"test_schema_no_geometry"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# OOM error on ofborg:
"test_engine_geometry_coerce_crs"
# pandera.errors.SchemaError: Error while coercing 'geometry' to type geometry
"test_schema_dtype_crs_with_coerce"
]
++ lib.optionals (pythonAtLeast "3.13") [
# AssertionError: assert DataType(Sparse[float64, nan]) == DataType(Sparse[float64, nan])
"test_legacy_default_pandas_extension_dtype"
];
pythonImportsCheck = [
"pandera"
"pandera.api"
"pandera.config"
"pandera.dtypes"
"pandera.engines"
];
meta = {
description = "Light-weight, flexible, and expressive statistical data testing library";
homepage = "https://pandera.readthedocs.io";
changelog = "https://github.com/unionai-oss/pandera/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ bcdarwin ];
};
}
|