Skip to content

Commit b795f0b

Browse files
authored
Bump version: 4.0.0 → 4.1.0 (#119)
1 parent 3c259e6 commit b795f0b

18 files changed

+417
-63
lines changed

.bumpversion.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.bumpversion]
2-
current_version = "4.0.0"
2+
current_version = "4.1.0"
33
commit = false
44
tag = false
55

CHANGELOG.rst

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,136 @@ Changelog
55

66
=========
77

8+
4.1.0 (2025-11-28)
9+
------------------
10+
11+
Features
12+
~~~~~~~~
13+
14+
Decimal Data Type Support
15+
*************************
16+
17+
This release adds support for ingesting data into QuestDB's native
18+
``DECIMAL(precision, scale)`` column type introduced in QuestDB 9.2.0.
19+
Use decimals when you need exact-precision values (e.g. prices, balances)
20+
without floating-point rounding issues.
21+
22+
Decimal values can be sent using Python ``decimal.Decimal`` objects in both
23+
``row()`` and ``dataframe()`` methods. When sending dataframes, you can also use
24+
PyArrow decimal types for better performance.
25+
26+
Sending decimals requires protocol version 3. When using HTTP, this protocol
27+
version is auto-negotiated. For TCP connections, you must explicitly specify
28+
``protocol_version=3`` in the configuration string:
29+
30+
.. code-block:: python
31+
32+
# HTTP - protocol version 3 is auto-negotiated
33+
conf = 'http::addr=localhost:9000;'
34+
35+
# TCP - must specify protocol_version=3 explicitly
36+
conf = 'tcp::addr=localhost:9009;protocol_version=3;'
37+
38+
.. important::
39+
**Server Requirement**: This feature requires QuestDB server version 9.2.0 or higher.
40+
41+
Unlike other column types, DECIMAL columns **must be created in advance** via SQL
42+
before ingesting data. Auto-creation is not supported for DECIMAL columns.
43+
44+
For details on creating DECIMAL columns and working with this data type, see the
45+
`QuestDB Decimal documentation <https://questdb.com/docs/concept/decimal/>`_.
46+
47+
**Usage with Python Decimal objects:**
48+
49+
.. code-block:: python
50+
51+
from decimal import Decimal
52+
from questdb.ingress import Sender, TimestampNanos
53+
54+
# First, create the table with DECIMAL column via SQL:
55+
# CREATE TABLE trades (
56+
# symbol SYMBOL,
57+
# price DECIMAL(18,4),
58+
# amount DECIMAL(18,8),
59+
# timestamp TIMESTAMP
60+
# ) TIMESTAMP(timestamp);
61+
62+
conf = 'http::addr=localhost:9000;'
63+
with Sender.from_conf(conf) as sender:
64+
sender.row(
65+
'trades',
66+
symbols={'symbol': 'ETH-USD'},
67+
columns={
68+
'price': Decimal('2615.5400'),
69+
'amount': Decimal('0.00044000')},
70+
at=TimestampNanos.now())
71+
72+
**Usage with Python Decimal objects in Pandas dataframes:**
73+
74+
.. code-block:: python
75+
76+
import pandas as pd
77+
from decimal import Decimal
78+
79+
# Create DataFrame with Python Decimal objects
80+
df = pd.DataFrame({
81+
'symbol': ['ETH-USD', 'BTC-USD'],
82+
'price': [Decimal('2615.5400'), Decimal('43210.1234')],
83+
'volume': [Decimal('1234.56789012'), Decimal('98.76543210')]
84+
})
85+
86+
with Sender.from_conf(conf) as sender:
87+
sender.dataframe(
88+
df,
89+
table_name='trades',
90+
symbols='symbol',
91+
at=TimestampNanos.now())
92+
93+
**Usage with PyArrow Decimal types in Pandas dataframes:**
94+
95+
.. code-block:: python
96+
97+
import pandas as pd
98+
import pyarrow as pa
99+
from decimal import Decimal
100+
101+
# Create DataFrame with Arrow decimal types
102+
df = pd.DataFrame({
103+
'prices': pd.array(
104+
[Decimal('-99999.99'), Decimal('-678.00')],
105+
dtype=pd.ArrowDtype(pa.decimal128(18, 2))
106+
)
107+
})
108+
109+
with Sender.from_conf(conf) as sender:
110+
sender.dataframe(df, table_name='prices', at=TimestampNanos.now())
111+
112+
Additional Arrow Data Type Support
113+
**********************************
114+
115+
Added support for additional PyArrow column types commonly encountered when
116+
deserializing from Parquet files or converting Polars dataframes to Pandas:
117+
118+
* ``int16``, ``int32``, ``float32`` (float), ``bool``
119+
* ``string``, ``large_string`` (including as symbol types)
120+
* ``timestamp[us]`` with timezone support for microsecond-precision timestamps
121+
122+
Microsecond Timestamp Precision
123+
*******************************
124+
125+
Microsecond-precision timestamp columns (``datetime64[us]`` in NumPy and
126+
``timestamp[us]`` in PyArrow) are now fully supported. When using
127+
``protocol_version`` 2 or higher, microsecond timestamps are sent with full
128+
precision, including for the designated timestamp column.
129+
130+
Bug fixes
131+
~~~~~~~~~
132+
133+
* Updated type hints to allow ``None`` as a valid column value in
134+
``Sender.row()``. This brings the type annotations in line with the actual
135+
behavior, where ``None`` values have always been supported to represent NULL
136+
values.
137+
8138
4.0.0 (2025-10-17)
9139
------------------
10140

README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
QuestDB Client Library for Python
33
=================================
44

5-
This is the official Python client library for `QuestDB <https://questdb.io>`_.
5+
This is the official Python client library for `QuestDB <https://questdb.com>`_.
66

77
This client library implements QuestDB's variant of the
8-
`InfluxDB Line Protocol <https://questdb.io/docs/reference/api/ilp/overview/>`_
8+
`InfluxDB Line Protocol <https://questdb.com/docs/reference/api/ilp/overview/>`_
99
(ILP) over HTTP and TCP.
1010

1111
ILP provides the fastest way to insert data into QuestDB.
@@ -18,7 +18,7 @@ and full-connection encryption with
1818
Install
1919
=======
2020

21-
The latest version of the library is 4.0.0 (`changelog <https://py-questdb-client.readthedocs.io/en/latest/changelog.html>`_).
21+
The latest version of the library is 4.1.0 (`changelog <https://py-questdb-client.readthedocs.io/en/latest/changelog.html>`_).
2222

2323
::
2424

@@ -27,7 +27,7 @@ The latest version of the library is 4.0.0 (`changelog <https://py-questdb-clien
2727
Quickstart
2828
==========
2929

30-
Start by `setting up QuestDB <https://questdb.io/docs/quick-start/>`_ .
30+
Start by `setting up QuestDB <https://questdb.com/docs/quick-start/>`_ .
3131
Once set up, you can use this library to insert data.
3232

3333
The most common way to insert data is from a Pandas dataframe.
@@ -98,7 +98,7 @@ guide.
9898
Links
9999
=====
100100

101-
* `Core database documentation <https://questdb.io/docs/>`_
101+
* `Core database documentation <https://questdb.com/docs/>`_
102102

103103
* `Python library documentation <https://py-questdb-client.readthedocs.io/>`_
104104

@@ -109,10 +109,10 @@ Links
109109
Community
110110
=========
111111

112-
Stop by our `Community Forum <https://community.questdb.io>`_ to
112+
Stop by our `Community Forum <https://community.questdb.com>`_ to
113113
chat with the QuestDB team.
114114

115-
You can also `sign up to our mailing list <https://questdb.io/contributors/>`_
115+
You can also `sign up to our mailing list <https://questdb.com/contributors/>`_
116116
to get notified of new releases.
117117

118118

docs/changelog.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1+
.. _changelog:
2+
3+
=========
4+
Changelog
5+
=========
6+
7+
.. contents::
8+
:local:
9+
:depth: 1
10+
111
.. include:: ../CHANGELOG.rst
12+
:start-line: 7

docs/community.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Chat to us
3333
==========
3434

3535
If you want to engage with us to discuss your changes or if you need help,
36-
there's a `#contributors` channel on our `slack <http://slack.questdb.io>`_ server
36+
there's a `#contributors` channel on our `slack <http://slack.questdb.com>`_ server
3737
just for that.
3838

3939
Asking for help
@@ -46,4 +46,4 @@ We monitor the `questdb` tag and will get back to you.
4646
Stack overflow helps us to keep track of the questions and answers, and it helps
4747
other users who might have the same question.
4848

49-
Alternatively, you can ask on our `slack <http://slack.questdb.io>`_ server.
49+
Alternatively, you can ask on our `slack <http://slack.questdb.com>`_ server.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
year = '2024'
2929
author = 'QuestDB'
3030
copyright = '{0}, {1}'.format(year, author)
31-
version = release = '4.0.0'
31+
version = release = '4.1.0'
3232

3333
github_repo_url = 'https://github.com/questdb/py-questdb-client'
3434

docs/conf.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ Authentication
7272
==============
7373

7474
If you're using QuestDB enterprise you can read up on creating and permissioning
75-
users in the `Enterprise quickstart <https://questdb.io/docs/guides/enterprise-quick-start/#4-ingest-data-influxdb-line-protocol>`_
76-
and the `role-based access control <https://questdb.io/docs/operations/rbac/>`_ guides.
75+
users in the `Enterprise quickstart <https://questdb.com/docs/guides/enterprise-quick-start/#4-ingest-data-influxdb-line-protocol>`_
76+
and the `role-based access control <https://questdb.com/docs/operations/rbac/>`_ guides.
7777

7878
HTTP Bearer Token
7979
-----------------
@@ -106,7 +106,7 @@ TLS
106106

107107
TLS in enabled by selecting the ``tcps`` or ``https`` protocol.
108108

109-
See the `QuestDB enterprise TLS documentation <https://questdb.io/docs/operations/tls/>`_
109+
See the `QuestDB enterprise TLS documentation <https://questdb.com/docs/operations/tls/>`_
110110
on how to enable this feature in the server.
111111

112112
Open source QuestDB does not offer TLS support out of the box, but you can
@@ -154,7 +154,7 @@ For more details on using self-signed test certificates, see:
154154

155155
* For Open Source QuestDB: https://github.com/questdb/c-questdb-client/blob/main/tls_certs/README.md#self-signed-certificates
156156

157-
* For QuestDB Enterprise: https://questdb.io/docs/operations/tls/#demo-certificates
157+
* For QuestDB Enterprise: https://questdb.com/docs/operations/tls/#demo-certificates
158158

159159
.. _sender_conf_auto_flush:
160160

@@ -239,6 +239,8 @@ Valid options are:
239239

240240
* ``2`` - Array support and binary format serialization for 64-bit floats (version specific to QuestDB).
241241

242+
* ``3`` - Decimal type support (requires QuestDB 9.2.0+). Also includes all features from version 2.
243+
242244
* ``auto`` (default) - Automatic version selection based on protocol type.
243245

244246
HTTP/HTTPS: Auto-detects server capability during handshake (supports version negotiation)
@@ -247,6 +249,9 @@ Valid options are:
247249

248250
.. note::
249251
Protocol version ``2`` requires QuestDB server version 9.0.0 or higher.
252+
253+
Protocol version ``3`` requires QuestDB server version 9.2.0 or higher and
254+
is needed for ingesting data into ``DECIMAL`` columns.
250255

251256
.. _sender_conf_buffer:
252257

docs/examples.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,44 @@ name.
109109

110110
For details on all options, see the
111111
:func:`Buffer.dataframe <questdb.ingress.Buffer.dataframe>` method.
112+
113+
114+
Decimal Types (QuestDB 9.2.0+)
115+
------------------------------
116+
117+
The following example shows how to insert data with decimal precision using
118+
Python's :class:`decimal.Decimal` type.
119+
120+
Requires QuestDB server 9.2.0+ and :ref:`protocol version 3 <sender_conf_protocol_version>`
121+
(must be :ref:`configured explicitly for TCP/TCPS <sender_conf_protocol_version>`).
122+
``DECIMAL`` columns must be :ref:`pre-created <sender_auto_creation>` (auto-creation not supported).
123+
See the :ref:`troubleshooting guide <troubleshooting-flushing>` for common errors.
124+
125+
First, create the table with ``DECIMAL`` columns:
126+
127+
.. code-block:: sql
128+
129+
CREATE TABLE financial_data (
130+
symbol SYMBOL,
131+
price DECIMAL(18, 6),
132+
quantity DECIMAL(12, 4),
133+
timestamp TIMESTAMP_NS
134+
) TIMESTAMP(timestamp) PARTITION BY DAY;
135+
136+
Then insert data using Python decimals:
137+
138+
.. literalinclude:: ../examples/decimal.py
139+
:language: python
140+
141+
For better performance with DataFrames, use PyArrow decimal types:
142+
143+
.. literalinclude:: ../examples/decimal_arrow.py
144+
:language: python
145+
146+
.. note::
147+
148+
For HTTP/HTTPS, protocol version 3 is auto-negotiated.
149+
For TCP/TCPS, explicitly configure: ``tcp::addr=localhost:9009;protocol_version=3;``
150+
151+
For more details, see the
152+
`QuestDB DECIMAL documentation <https://questdb.com/docs/reference/sql/datatypes/#decimal>`_.

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. image:: logo.svg
2-
:target: https://questdb.io/
2+
:target: https://questdb.com/
33
:alt: QuestDB
44
:width: 400px
55

@@ -9,7 +9,7 @@ Contents
99
========
1010

1111
.. toctree::
12-
:maxdepth: 2
12+
:maxdepth: 1
1313

1414
installation
1515
sender

0 commit comments

Comments
 (0)