From: Daniele Varrazzo Date: Mon, 9 Jan 2023 08:30:41 +0000 (+0000) Subject: docs: add news entry and docs about numpy scalars support X-Git-Tag: pool-3.2.0~70^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=157a2e2bef14f1a7f54c9df6f9ff0279536c9897;p=thirdparty%2Fpsycopg.git docs: add news entry and docs about numpy scalars support --- diff --git a/docs/basic/adapt.rst b/docs/basic/adapt.rst index 069af7cfc..91e8e6409 100644 --- a/docs/basic/adapt.rst +++ b/docs/basic/adapt.rst @@ -34,6 +34,9 @@ Python `bool` values `!True` and `!False` are converted to the equivalent .. __: https://www.postgresql.org/docs/current/datatype-boolean.html +.. versionchanged:: 3.2 + `numpy.bool_` values can be dumped too. + .. index:: single: Adaptation; numbers @@ -73,6 +76,13 @@ promoted to the larger Python counterpart. an adapter to :ref:`cast PostgreSQL numeric to Python float `. This of course may imply a loss of precision. +.. versionchanged:: 3.2 + + NumPy integer__ and `floating point`__ values can be dumped too. + +.. __: https://numpy.org/doc/stable/reference/arrays.scalars.html#integer-types +.. __: https://numpy.org/doc/stable/reference/arrays.scalars.html#floating-point-types + .. index:: pair: Strings; Adaptation diff --git a/docs/conf.py b/docs/conf.py index 4677385ef..cafcb5e60 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -100,6 +100,7 @@ default_role = "obj" intersphinx_mapping = { "py": ("https://docs.python.org/3", None), "pg2": ("https://www.psycopg.org/docs/", None), + "numpy": ("https://numpy.org/doc/stable/", None), } autodoc_member_order = "bysource" diff --git a/docs/news.rst b/docs/news.rst index 7d5e2e9c0..b306f6e39 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -13,6 +13,8 @@ Future releases Psycopg 3.2 (unreleased) ^^^^^^^^^^^^^^^^^^^^^^^^ +- Add support for integer, floating point, boolean `NumPy scalar types`__ + (:ticket:`#332`). - Add support for libpq functions to close prepared statements and portals introduced in libpq v17 (:ticket:`#603`). - Disable receiving more than one result on the same cursor in pipeline mode, @@ -21,6 +23,8 @@ Psycopg 3.2 (unreleased) The `Cursor` now only preserves the results set of the last `~Cursor.execute()`, consistently with non-pipeline mode. +.. __: https://numpy.org/doc/stable/reference/arrays.scalars.html#built-in-scalar-types + Current release ---------------