Skip to content

Commit

Permalink
Fix public export promote_nullable (#14)
Browse files Browse the repository at this point in the history
Co-authored-by: Aditya Goel <[email protected]>
  • Loading branch information
EmilyMohellenbrandQC and adityagoel4512 authored Jul 11, 2024
1 parent 9eb981a commit b824fec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
Changelog
=========

0.6.0 (2024-07-11)
------------------

**Other changes**

- :func:`ndonnx.promote_nullable` is now publicly exported

0.5.0 (2024-07-01)
------------------

Expand Down
1 change: 1 addition & 0 deletions ndonnx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
NullableIntegral,
NullableNumerical,
Numerical,
promote_nullable,
from_numpy_dtype,
bool,
float32,
Expand Down
8 changes: 8 additions & 0 deletions ndonnx/_data_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import annotations
from warnings import warn

from .aliases import (
bool,
Expand Down Expand Up @@ -50,6 +51,7 @@
from .structtype import StructType


# TODO: to be removed
def promote_nullable(dtype: StructType | CoreType) -> _NullableCore:
"""Promotes a non-nullable type to its nullable counterpart, if present.
Expand All @@ -69,6 +71,12 @@ def promote_nullable(dtype: StructType | CoreType) -> _NullableCore:
If the input type is unknown to ``ndonnx``.
"""

warn(
"Function 'ndonnx.promote_nullable' will be deprecated in ndonnx 0.7. "
"To create nullable array, use 'ndonnx.additional.make_nullable' instead.",
DeprecationWarning,
)

if dtype == bool:
return nbool
elif dtype == float32:
Expand Down

0 comments on commit b824fec

Please sign in to comment.