Skip to content

Commit 86d5bc7

Browse files
authored
Merge pull request #1 from Pymetheus/update-main
v0.1.5 Update
2 parents 7a178cc + a50599c commit 86d5bc7

3 files changed

Lines changed: 25 additions & 4 deletions

File tree

docs/SECURITY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ If you believe you have found a security vulnerability, please report it to us a
44

55
## Supported Versions
66

7-
Currently only the 0.1.4 version of the sqlalchemy-dbtoolkit is supported.
7+
Currently only the 0.1.5 version of the sqlalchemy-dbtoolkit is supported.
88

99
| Version | Supported |
10-
| ------- | ------------------ |
11-
| 0.1.4 | :white_check_mark: |
10+
|---------| ------------------ |
11+
| 0.1.5 | :white_check_mark: |
1212
| others | :x: |
1313

1414
## Reporting a Vulnerability

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="sqlalchemy-dbtoolkit",
8-
version="0.1.4",
8+
version="0.1.5",
99
description="A toolkit for building SQLAlchemy database engines and utilities.",
1010
long_description=long_description,
1111
long_description_content_type="text/markdown",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import pandas as pd
2+
3+
4+
def sanitize_nan_to_none(value):
5+
"""
6+
Converts NaN-like values to None for safe SQL insertion.
7+
8+
Args:
9+
value (any): The value to sanitize. Can be of any type, including float, string, or None.
10+
11+
Returns:
12+
any: None if the value represents missing data (e.g., np.nan, pd.NA, or the string "NaN");
13+
otherwise, returns the original value.
14+
"""
15+
16+
if pd.isna(value):
17+
return None
18+
elif isinstance(value, str) and value.strip().lower() == "nan":
19+
return None
20+
else:
21+
return value

0 commit comments

Comments
 (0)