File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1+ PENDING: Dataiter 1.0
2+ =====================
3+
4+ * Silence warnings about writing NPZ files with StringDType:
5+ "UserWarning: Custom dtypes are saved as python objects using the
6+ pickle protocol. Loading this file requires allow_pickle=True to be
7+ set."
8+
192025-01-12: Dataiter 0.9999
210===========================
311
Original file line number Diff line number Diff line change 2020# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121# THE SOFTWARE.
2222
23+ import warnings
24+
2325from numpy .dtypes import StringDType
2426
2527#: Instance of NumPy variable-width StringDType used
3032# input, a distinction between NA and blank cannot usually be made.
3133# TODO: Consider changing this to something like ':NA:'.
3234# https://numpy.org/doc/stable/user/basics.strings.html#missing-data-support
35+
36+ # Ignore pointless warnings about using StringDType in numpy.savez.
37+ _pattern = "Custom dtypes are saved as python objects using the pickle protocol"
38+ warnings .filterwarnings ("ignore" , message = _pattern , category = UserWarning )
Original file line number Diff line number Diff line change 3131from pathlib import Path
3232from unittest .mock import patch
3333
34- # This UserWarning seems unavoidable when using StringDtype, which unlike
35- # other dtypes must be instantiated and that custom instance used.
36- IGNORE_NPZ_PICKLE_WARNING = "ignore:Custom dtypes are saved as python objects using the pickle protocol."
34+ # See dataiter/dtypes.py for the equivalent non-test ignore.
35+ IGNORE_NPZ_PICKLE_WARNING = "ignore:Custom dtypes are saved as python objects using the pickle protocol"
3736
3837class TestDataFrameColumn :
3938
You can’t perform that action at this time.
0 commit comments