Skip to content

Commit 1e6a9aa

Browse files
authored
Merge pull request #290 from tylerriccio33/pct-null
Add percentage null assertion
2 parents a4ca00d + 38ae6c8 commit 1e6a9aa

File tree

8 files changed

+770
-19
lines changed

8 files changed

+770
-19
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
.PHONY: test
44
test:
5-
@uv run pytest \
5+
@uv run pytest tests \
66
--cov=pointblank \
77
--cov-report=term-missing \
88
--randomly-seed 123 \
99
-n auto \
1010
--reruns 3 \
11-
--reruns-delay 1
11+
--reruns-delay 1 \
12+
--doctest-modules pointblank \
13+
--durations 10
1214

1315
.PHONY: test-core
1416
test-core: ## Run core libraries only; useful for local CI
@@ -26,6 +28,10 @@ test-core: ## Run core libraries only; useful for local CI
2628
test-update:
2729
pytest --snapshot-update
2830

31+
.PHONY: pre-commit
32+
pre-commit: ## Run pre-commit hooks
33+
@uvx pre-commit run --all-files
34+
2935
.PHONY: lint
3036
lint: ## Run ruff formatter and linter
3137
@uv run ruff format

pointblank/_constants.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"not_null": ["str", "numeric", "bool", "datetime", "duration"],
2424
}
2525

26-
ASSERTION_TYPE_METHOD_MAP = {
26+
ASSERTION_TYPE_METHOD_MAP: dict[str, str] = {
27+
"col_pct_null": "pct_null",
2728
"col_vals_gt": "gt",
2829
"col_vals_lt": "lt",
2930
"col_vals_eq": "eq",
@@ -359,6 +360,19 @@
359360
<path d="M40.6120891,47.0378516 C37.4692395,47.0378516 35.0126155,45.9348776 33.712234,44.0140735 C32.4118524,45.9348776 29.9552284,47.0378516 26.8123796,47.0378516 C22.6574258,47.0378516 16.0646491,43.4437854 16.0646491,33.802163 C16.0646491,29.3401315 17.4715675,18.9621484 30.5035822,18.9621484 C30.9453983,18.9621484 31.3057451,19.3224952 31.3057451,19.7643113 L31.3057451,21.3686372 C31.3057451,21.8104533 30.9453983,22.1708002 30.5035822,22.1708002 C26.6400397,22.1708002 22.4819527,25.8118683 22.4819527,33.802163 C22.4819527,37.5090333 23.7635331,43.0270369 27.2949304,43.0270369 C29.7954231,43.0270369 31.2242758,40.4231405 32.0985075,38.2861287 C30.5067154,35.6101628 29.7014192,33.1034036 29.7014192,30.8347865 C29.7014192,25.6238614 31.8603654,23.7751261 33.712234,23.7751261 C35.5641025,23.7751261 37.7230487,25.6238614 37.7230487,30.8347865 C37.7230487,33.1347385 36.9396869,35.5788287 35.3290937,38.2861287 C36.6294752,41.4321115 38.2432017,43.0270369 40.1295376,43.0270369 C43.6609348,43.0270369 44.9425153,37.5090333 44.9425153,33.802163 C44.9425153,25.8118683 40.7844282,22.1708002 36.9208858,22.1708002 C36.4759364,22.1708002 36.1187228,21.8104533 36.1187228,21.3686372 L36.1187228,19.7643113 C36.1187228,19.3224952 36.4759364,18.9621484 36.9208858,18.9621484 C49.9529005,18.9621484 51.3598189,29.3401315 51.3598189,33.802163 C51.3598189,43.4437854 44.7670421,47.0378516 40.6120891,47.0378516 Z" id="omega" fill="#000000" fill-rule="nonzero"></path>
360361
</g>
361362
</g>
363+
</svg>""",
364+
"col_pct_null": """<?xml version="1.0" encoding="UTF-8"?>
365+
<svg width="67px" height="67px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background: #FFFFFF;">
366+
<title>pct_null</title>
367+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
368+
<g id="col_vals_null" transform="translate(1.000000, 1.581717)" fill-rule="nonzero">
369+
<path d="M55,0 C57.4852813,0 59.7352813,1.00735931 61.363961,2.63603897 C62.9926407,4.26471863 64,6.51471863 64,9 L64,9 L64,64 L9,64 C6.51471862,64 4.26471862,62.9926407 2.63603897,61.363961 C1.00735931,59.7352814 0,57.4852814 0,55 L0,55 L0,9 C0,6.51471863 1.00735931,4.26471863 2.63603897,2.63603897 C4.26471862,1.00735931 6.51471862,0 9,0 L9,0 L55,0 Z" id="rectangle" stroke="#000000" stroke-width="2" fill="#FFFFFF"></path>
370+
<path d="M45.4146228,41.5 C43.2877254,41.5 41.6252254,40.7535715 40.745203,39.4536832 C39.8651805,40.7535715 38.2026805,41.5 36.0757835,41.5 C33.2639529,41.5 28.8023458,39.0677454 28.8023458,32.5428572 C28.8023458,29.5232143 29.7544662,22.5 38.5737744,22.5 C38.8727698,22.5 39.1166315,22.7438617 39.1166315,23.0428571 L39.1166315,24.1285714 C39.1166315,24.4275668 38.8727698,24.6714286 38.5737744,24.6714286 C35.9591539,24.6714286 33.1452029,27.1354913 33.1452029,32.5428572 C33.1452029,35.051451 34.0125019,38.7857143 36.4023458,38.7857143 C38.0945336,38.7857143 39.0614978,37.023549 39.6531269,35.5773439 C38.5758948,33.7664061 38.0309172,32.0699775 38.0309172,30.5347097 C38.0309172,27.0082592 39.4919662,25.7571429 40.745203,25.7571429 C41.9984397,25.7571429 43.4594886,27.0082592 43.4594886,30.5347097 C43.4594886,32.0911832 42.929355,33.745201 41.8393994,35.5773439 C42.7194218,37.7063617 43.8114979,38.7857143 45.0880601,38.7857143 C47.477904,38.7857143 48.345203,35.051451 48.345203,32.5428572 C48.345203,27.1354913 45.5312519,24.6714286 42.9166315,24.6714286 C42.6155157,24.6714286 42.3737744,24.4275668 42.3737744,24.1285714 L42.3737744,23.0428571 C42.3737744,22.7438617 42.6155157,22.5 42.9166315,22.5 C51.7359397,22.5 52.6880601,29.5232143 52.6880601,32.5428572 C52.6880601,39.0677454 48.2264529,41.5 45.4146228,41.5 Z" id="omega" fill="#000000"></path>
371+
<g id="percent" transform="translate(11.268508, 23.854373)" fill="#000000">
372+
<path d="M1.89920553,17.2037988 C1.78720553,17.1237988 1.664,17.0296274 1.584,16.8936274 C1.504,16.7576274 1.464,16.6096274 1.464,16.4496274 C1.464,16.2416274 1.536,16.0336274 1.68,15.8256274 L12.24,0.489627434 C12.432,0.185627434 12.5942662,0 12.9462662,0 C13.1542662,0 13.472,0.089627434 13.68,0.201627434 C14.048,0.425627434 14.232,0.681627434 14.232,0.969627434 C14.232,1.14562743 14.16,1.34562743 14.016,1.56962743 L3.432,16.9776274 C3.176,17.2816274 2.88,17.4336274 2.544,17.4336274 C2.336,17.4336274 2.13920553,17.3477988 1.89920553,17.2037988 Z M3.864,7.47362743 C3.176,7.47362743 2.536,7.30562743 1.944,6.96962743 C1.352,6.63362743 0.88,6.18162743 0.528,5.61362743 C0.176,5.04562743 0,4.42562743 0,3.75362743 C0,3.08162743 0.172,2.46162743 0.516,1.89362743 C0.86,1.32562743 1.328,0.877627434 1.92,0.549627434 C2.512,0.221627434 3.16,0.057627434 3.864,0.057627434 C4.568,0.057627434 5.216,0.221627434 5.808,0.549627434 C6.4,0.877627434 6.864,1.32562743 7.2,1.89362743 C7.536,2.46162743 7.704,3.08162743 7.704,3.75362743 C7.704,4.42562743 7.532,5.04562743 7.188,5.61362743 C6.844,6.18162743 6.38,6.63362743 5.796,6.96962743 C5.212,7.30562743 4.568,7.47362743 3.864,7.47362743 Z M3.864,5.69762743 C4.408,5.69762743 4.852,5.51362743 5.196,5.14562743 C5.54,4.77762743 5.712,4.31362743 5.712,3.75362743 C5.712,3.17762743 5.54,2.70562743 5.196,2.33762743 C4.852,1.96962743 4.408,1.78562743 3.864,1.78562743 C3.304,1.78562743 2.848,1.96962743 2.496,2.33762743 C2.144,2.70562743 1.968,3.17762743 1.968,3.75362743 C1.968,4.31362743 2.144,4.77762743 2.496,5.14562743 C2.848,5.51362743 3.304,5.69762743 3.864,5.69762743 Z M11.952,17.3856274 C11.248,17.3856274 10.6,17.2176274 10.008,16.8816274 C9.416,16.5456274 8.948,16.0936274 8.604,15.5256274 C8.26,14.9576274 8.088,14.3376274 8.088,13.6656274 C8.088,12.9936274 8.26,12.3736274 8.604,11.8056274 C8.948,11.2376274 9.416,10.7896274 10.008,10.4616274 C10.6,10.1336274 11.248,9.96962743 11.952,9.96962743 C12.656,9.96962743 13.3,10.1336274 13.884,10.4616274 C14.468,10.7896274 14.928,11.2376274 15.264,11.8056274 C15.6,12.3736274 15.768,12.9936274 15.768,13.6656274 C15.768,14.3376274 15.596,14.9576274 15.252,15.5256274 C14.908,16.0936274 14.444,16.5456274 13.86,16.8816274 C13.276,17.2176274 12.64,17.3856274 11.952,17.3856274 Z M11.952,15.6096274 C12.48,15.6096274 12.92,15.4296274 13.272,15.0696274 C13.624,14.7096274 13.8,14.2416274 13.8,13.6656274 C13.8,13.1056274 13.624,12.6416274 13.272,12.2736274 C12.92,11.9056274 12.48,11.7216274 11.952,11.7216274 C11.392,11.7216274 10.932,11.9056274 10.572,12.2736274 C10.212,12.6416274 10.032,13.1056274 10.032,13.6656274 C10.032,14.2416274 10.212,14.7096274 10.572,15.0696274 C10.932,15.4296274 11.392,15.6096274 11.952,15.6096274 Z"></path>
373+
</g>
374+
</g>
375+
</g>
362376
</svg>""",
363377
"col_vals_not_null": """<?xml version="1.0" encoding="UTF-8"?>
364378
<svg width="67px" height="67px" viewBox="0 0 67 67" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

0 commit comments

Comments
 (0)