Skip to content

Stabilising changes for version 3.0.0 #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0bf9db4
pointing submodule to v5 branch
amunra Jun 3, 2025
a339977
Reverting unnecessary name change
amunra Jun 3, 2025
bde6396
consolidating array error codes
amunra Jun 3, 2025
47476db
add c-major array layout api.
kafka1991 Jun 4, 2025
04ac3cf
Merge remote-tracking branch 'origin/main' into v3
kafka1991 Jun 9, 2025
ab6882b
update numpy dep version.
kafka1991 Jun 9, 2025
cfa4104
add ci on various numpy version.
kafka1991 Jun 9, 2025
d4a4f26
add ci on various numpy version
kafka1991 Jun 9, 2025
dd4515a
add ci on various numpy version
kafka1991 Jun 9, 2025
2be594f
fix doc warnings.
kafka1991 Jun 9, 2025
79bfff7
fix test warnings.
kafka1991 Jun 9, 2025
0e01601
doc first version of QuestDB support arrays.
kafka1991 Jun 9, 2025
fcada80
adapt new c interface.
kafka1991 Jun 18, 2025
9794183
update c module and fix ci
kafka1991 Jun 18, 2025
1b42514
fix ci
kafka1991 Jun 18, 2025
b5a7c4d
updated c-questdb-client submodule
amunra Jun 20, 2025
37741d3
fast reconnection warning
amunra Jun 20, 2025
a50ebc1
fixed a few sphinx issues, 3 more remaining
amunra Jun 20, 2025
f459102
fixed remaining sphinx issues
amunra Jun 20, 2025
f7fc761
should fix CI
amunra Jun 23, 2025
da02265
Rewrote high reconnection detection logic in Rust to make writing tes…
amunra Jun 23, 2025
3eb128e
oops, I'd missed one..
amunra Jun 23, 2025
0040381
Written changelog, bumped version
amunra Jun 24, 2025
ffeeebe
doc improvements
amunra Jun 24, 2025
34b2aa1
fastparquet now ships for 3.13
amunra Jun 24, 2025
d1a5116
updated c-questdb-client dependency
amunra Jul 7, 2025
f517c91
fixed license + tooling dependency issues
amunra Jul 7, 2025
f259701
updated mentions of which version supports arrays to QuestDB 9.0.0
amunra Jul 7, 2025
86c6567
doc clean-up
amunra Jul 7, 2025
7cb771a
changelog and doc improvements
amunra Jul 7, 2025
5ca5555
fixed CI by building questdb with Java 17
amunra Jul 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .bumpversion.cfg

This file was deleted.

39 changes: 39 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[tool.bumpversion]
current_version = "3.0.0"
commit = false
tag = false

[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "setup.py"
search = "version='{current_version}'"
replace = "version='{new_version}'"

[[tool.bumpversion.files]]
filename = "README.rst"
search = "library is {current_version}"
replace = "library is {new_version}"

[[tool.bumpversion.files]]
filename = "docs/conf.py"
search = "version = release = '{current_version}'"
replace = "version = release = '{new_version}'"

[[tool.bumpversion.files]]
filename = "src/questdb/__init__.py"
search = "__version__ = '{current_version}'"
replace = "__version__ = '{new_version}'"

[[tool.bumpversion.files]]
filename = "src/questdb/ingress.pyx"
search = "VERSION = '{current_version}'"
replace = "VERSION = '{new_version}'"

[[tool.bumpversion.files]]
filename = ".bumpversion.toml"
search = "current_version = \"{current_version}\""
replace = "current_version = \"{new_version}\""
74 changes: 74 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,76 @@ Changelog

=========

3.0.0 (2025-07-07)
------------------

Features
~~~~~~~~

This is the first major release of the QuestDB Python client library
which supports n-dimensional arrays of doubles for QuestDB servers 9.0.0 and up.

.. code-block:: python

import numpy as np

# Create 2D numpy array
array_2d = np.array([
[1.1, 2.2, 3.3],
[4.4, 5.5, 6.6]], dtype=np.float64)

sender.row(
'table',
columns={'array_2d': array_2d},
at=timestamp)

The array data is sent over a new protocol version (2) that is auto-negotiated
when using HTTP(s), or can be specified explicitly via the ``protocol_version=2``
parameter when using TCP(s).

We recommend using HTTP(s), but here is an TCP example, should you need it::

tcp::addr=localhost:9009;protocol_version=2;

When using ``protocol_version=2`` (with either TCP(s) or HTTP(s)), the sender
will now also serialize ``float`` (double-precision) columns as binary.
You might see a performance uplift if this is a dominant data type in your
ingestion workload.

When compared to 2.0.4, this release includes all the changes from 3.0.0rc1 and
additionally:

* Has optimised ingestion performance from C-style contiguous NumPy arrays.

* Warns at most every 10 minutes when burst of reconnections are detected.
This is to warn about code patterns that may lead to performance issues, such as

.. code-block:: python

# Don't do this! Sender objects should be reused.
for row_fields in data:
with Sender.from_conf(conf) as sender:
sender.row(**row_fields)

This feature can be disabled in code by setting:

.. code-block:: python

import questdb.ingress as qi
qi.WARN_HIGH_RECONNECTS = False

* Fixed ILP/TCP connection shutdown on Windows where some rows could be
lost when closing the ``Sender``, even if explicitly flushed.

* Added a "Good Practices" section to the "Sending Data over ILP" section of
the documentation.

Breaking Changes
~~~~~~~~~~~~~~~~
Refer to the release notes for 3.0.0rc1 for the breaking changes introduced
in this release compared to 2.x.x.


3.0.0rc1 (2025-06-02)
---------------------

Expand All @@ -16,6 +86,10 @@ Features
* Array Data Type Support. Adds native support for NumPy arrays
(currently only for ``np.float64`` element type and up to 32 dimensions).

.. note::
**Server Requirement**: This feature requires QuestDB server version 9.0.0 or higher.
Ensure your server is upgraded before ingesting array types, otherwise data ingestion will fail.

.. code-block:: python

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion DEV_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ The development requirements are these if you prefer to install them one by one:
python3 -m pip install wheel
python3 -m pip install twine
python3 -m pip install cibuildwheel
python3 -m pip install bump2version


Building and packaging
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ recursive-include src *.py
recursive-include src *.md
recursive-include src *.pxi
recursive-include src *.c
graft pystr-to-utf8
graft rpyutils
graft c-questdb-client
prune c-questdb-client/src/tests/json_tests.rs
prune c-questdb-client/.git
Expand Down
15 changes: 4 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ QuestDB Client Library for Python
This is the official Python client library for `QuestDB <https://questdb.io>`_.

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

ILP provides the fastest way to insert data into QuestDB.
Expand All @@ -18,21 +18,12 @@ and full-connection encryption with
Install
=======

The latest *stable* version of the library is **2.0.4** (`changelog <https://py-questdb-client.readthedocs.io/en/latest/changelog.html>`_).
The latest version of the library is **3.0.0** (`changelog <https://py-questdb-client.readthedocs.io/en/latest/changelog.html>`_).

::

python3 -m pip install -U questdb[dataframe]


The latest *pre-release* version of the library is **3.0.0r1** (`changelog <https://py-questdb-client.readthedocs.io/en/latest/changelog.html>`_).
This release supports NumPy float64 arrays which are transmitted over a new
protocol version supported by QuestDB 8.4.0 or later.

::

python3 -m pip install --pre -U questdb[dataframe]

Quickstart
==========

Expand All @@ -53,6 +44,7 @@ The most common way to insert data is from a Pandas dataframe.
'amount': [0.00044, 0.001],

# NumPy float64 arrays are supported from v3.0.0rc1 onwards.
# Note that requires QuestDB server >= 9.0.0 for array support
'ord_book_bids': [
np.array([2615.54, 2618.63]),
np.array([39269.98, 39270.00])
Expand Down Expand Up @@ -82,6 +74,7 @@ You can also send individual rows. This only requires a more minimal installatio
'amount': 0.00044,

# NumPy float64 arrays are supported from v3.0.0rc1 onwards.
# Note that requires QuestDB server >= 9.0.0 for array support
'ord_book_bids': np.array([2615.54, 2618.63]),
},
at=TimestampNanos.now())
Expand Down
20 changes: 8 additions & 12 deletions RELEASING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,17 @@ Create a new PR with the new changes in ``CHANGELOG.rst``.

Make a commit and push the changes to a new branch.

You also want to bump the version.
You also want to bump the version. This process is semi-automated.

This process is automated by the following command:
* Ensure you have `uv` and `bump-my-version` installed:
* `curl -LsSf https://astral.sh/uv/install.sh | sh` : see https://docs.astral.sh/uv/getting-started/installation/
* `uv tool install bump-my-version`: see https://github.com/callowayproject/bump-my-version.

.. code-block:: bash

bump2version --config-file .bumpversion.cfg --no-tag patch

Here use:

* ``patch`` to bump the version to the next patch version, e.g. 1.0.0 -> 1.0.1

* ``minor`` to bump the version to the next minor version, e.g. 1.0.0 -> 1.1.0
```console
bump-my-version replace --new-version NEW_VERSION
```

* ``major`` to bump the version to the next major version, e.g. 1.0.0 -> 2.0.0
If you're unsure, append `--dry-run` to preview changes.

Now merge the PR with the title "Bump version: V.V.V → W.W.W".

Expand Down
2 changes: 1 addition & 1 deletion c-questdb-client
Submodule c-questdb-client updated 66 files
+0 −28 .bumpversion.cfg
+49 −0 .bumpversion.toml
+10 −1 CMakeLists.txt
+9 −6 README.md
+7 −0 ci/format_cpp.py
+18 −7 ci/run_all_tests.py
+5 −5 ci/run_tests_pipeline.yaml
+188 −32 cpp_test/test_line_sender.cpp
+19 −4 doc/C.md
+20 −4 doc/CPP.md
+0 −21 doc/DEV_NOTES.md
+8 −8 doc/RELEASING.md
+2 −2 doc/SECURITY.md
+10 −6 examples/concat.c
+2 −1 examples/concat.h
+11 −8 examples/line_sender_c_example.c
+9 −4 examples/line_sender_c_example_array_byte_strides.c
+101 −0 examples/line_sender_c_example_array_c_major.c
+9 −4 examples/line_sender_c_example_array_elem_strides.c
+14 −8 examples/line_sender_c_example_auth.c
+16 −9 examples/line_sender_c_example_auth_tls.c
+6 −6 examples/line_sender_c_example_from_conf.c
+4 −4 examples/line_sender_c_example_from_env.c
+8 −6 examples/line_sender_c_example_http.c
+22 −11 examples/line_sender_c_example_tls_ca.c
+13 −1 examples/line_sender_cpp_example_array_byte_strides.cpp
+67 −0 examples/line_sender_cpp_example_array_c_major.cpp
+159 −0 examples/line_sender_cpp_example_array_custom.cpp
+13 −1 examples/line_sender_cpp_example_array_elem_strides.cpp
+87 −40 include/questdb/ingress/line_sender.h
+419 −38 include/questdb/ingress/line_sender.hpp
+19 −22 questdb-rs-ffi/Cargo.lock
+2 −2 questdb-rs-ffi/Cargo.toml
+170 −60 questdb-rs-ffi/src/lib.rs
+637 −190 questdb-rs-ffi/src/ndarr.rs
+37 −23 questdb-rs/Cargo.toml
+44 −28 questdb-rs/README.md
+19 −17 questdb-rs/build.rs
+1 −0 questdb-rs/examples/basic.rs
+1 −0 questdb-rs/examples/http.rs
+2 −1 questdb-rs/examples/protocol_version.rs
+10 −10 questdb-rs/src/error.rs
+1 −1 questdb-rs/src/gai.rs
+1,275 −0 questdb-rs/src/ingress/buffer.rs
+79 −2 questdb-rs/src/ingress/conf.rs
+17 −1 questdb-rs/src/ingress/mod.md
+276 −2,005 questdb-rs/src/ingress/mod.rs
+18 −18 questdb-rs/src/ingress/ndarr.rs
+23 −73 questdb-rs/src/ingress/sender/http.rs
+314 −0 questdb-rs/src/ingress/sender/mod.rs
+245 −0 questdb-rs/src/ingress/sender/tcp.rs
+73 −21 questdb-rs/src/ingress/tests.rs
+247 −0 questdb-rs/src/ingress/tls.rs
+3 −0 questdb-rs/src/lib.rs
+80 −7 questdb-rs/src/tests/http.rs
+47 −33 questdb-rs/src/tests/mock.rs
+4 −5 questdb-rs/src/tests/mod.rs
+5 −5 questdb-rs/src/tests/ndarr.rs
+118 −20 questdb-rs/src/tests/sender.rs
+163 −122 system_test/fixture.py
+42 −3 system_test/questdb_line_sender.py
+35 −19 system_test/test.py
+510 −79 system_test/tls_proxy/Cargo.lock
+7 −7 system_test/tls_proxy/Cargo.toml
+10 −11 system_test/tls_proxy/src/lib.rs
+1 −1 system_test/tls_proxy/src/main.rs
1 change: 1 addition & 0 deletions ci/cibuildwheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ stages:
displayName: Build wheels
env:
CIBW_BUILD: pp*
CIBW_ENABLE: pypy pypy-eol
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'wheelhouse'}

Expand Down
5 changes: 2 additions & 3 deletions ci/pip_install_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def main(args):
ensure_timezone()
pip_install('pip')
pip_install('setuptools')
pip_install('packaging')
if args.pandas_version is not None and args.pandas_version != '':
install_old_pandas_and_numpy(args)
else:
Expand All @@ -92,9 +93,7 @@ def main(args):
import pandas
import numpy
import pyarrow
if (sys.version_info >= (3, 8) and sys.version_info < (3, 13)):
# As of this commit, fastparquet does not have a binary built for 3.13
import fastparquet
import fastparquet


if __name__ == "__main__":
Expand Down
52 changes: 51 additions & 1 deletion ci/run_tests_pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ stages:
lfs: false
submodules: true
- task: UsePythonVersion@0
inputs:
versionSpec: '3.12'
- script: |
python3 --version
python3 -m pip install cython
Expand All @@ -55,7 +57,7 @@ stages:
displayName: "Compile QuestDB"
inputs:
mavenPOMFile: 'questdb/pom.xml'
jdkVersionOption: '1.11'
jdkVersionOption: '1.17'
options: "-DskipTests -Pbuild-web-console"
condition: eq(variables.vsQuestDbMaster, true)
- script: python3 proj.py test 1
Expand All @@ -68,3 +70,51 @@ stages:
JAVA_HOME: $(JAVA_HOME_11_X64)
QDB_REPO_PATH: './questdb'
condition: eq(variables.vsQuestDbMaster, true)
- job: TestsAgainstVariousNumpyVersion1x
pool:
name: "Azure Pipelines"
vmImage: "ubuntu-latest"
timeoutInMinutes: 45
steps:
- checkout: self
fetchDepth: 1
lfs: false
submodules: true
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
- script: |
python3 --version
python3 -m pip install uv
sudo apt-get install -y libopenblas-dev pkg-config
displayName: "Install uv"
- script: uv run --with 'numpy==1.21.0' test/test.py -v TestBufferProtocolVersionV2
displayName: "Test vs numpy 1.21"
- script: uv run --with 'numpy==1.24.0' test/test.py -v TestBufferProtocolVersionV2
displayName: "Test vs numpy 1.24"
- script: uv run --with 'numpy==1.26.0' test/test.py -v TestBufferProtocolVersionV2
displayName: "Test vs numpy 1.26"
- job: TestsAgainstVariousNumpyVersion2x
pool:
name: "Azure Pipelines"
vmImage: "ubuntu-latest"
timeoutInMinutes: 45
steps:
- checkout: self
fetchDepth: 1
lfs: false
submodules: true
- task: UsePythonVersion@0
inputs:
versionSpec: '3.11'
- script: |
python3 --version
python3 -m pip install uv
sudo apt-get install -y libopenblas-dev pkg-config
displayName: "Install uv"
- script: uv run --with 'numpy==2.0.0' test/test.py -v TestBufferProtocolVersionV2
displayName: "Test vs numpy 2.0"
- script: uv run --with 'numpy==2.2.0' test/test.py -v TestBufferProtocolVersionV2
displayName: "Test vs numpy 2.2"
- script: uv run --with 'numpy==2.3.0' test/test.py -v TestBufferProtocolVersionV2
displayName: "Test vs numpy 2.3"
18 changes: 9 additions & 9 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
setuptools>=45.2.0
Cython>=0.29.32
wheel>=0.34.2
cibuildwheel>=2.11.2
Sphinx>=5.0.2
sphinx-rtd-theme>=1.0.0
twine>=4.0.1
bump2version>=1.0.1
setuptools>=80.9.0
packaging>=25.0
Cython>=3.1.2
wheel>=0.45.1
cibuildwheel>=3.0.1
Sphinx>=8.2.3
sphinx-rtd-theme>=3.0.2
twine>=6.1.0
pandas>=1.3.5
numpy>=1.21.6
numpy>=1.21.0
pyarrow>=10.0.1
fastparquet>=2023.10.1
7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

from questdb.ingress import *

autodoc_mock_imports = ["_cython"]
autodoc_type_aliases = {
'datetime': 'datetime.datetime',
}

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
Expand All @@ -23,7 +28,7 @@
year = '2024'
author = 'QuestDB'
copyright = '{0}, {1}'.format(year, author)
version = release = '3.0.0rc1'
version = release = '3.0.0'

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

Expand Down
Loading
Loading