Skip to content

Commit d26da90

Browse files
authored
BREAKING: New ILP/HTTP and Sender.from_conf API (#59)
1 parent fc8ce97 commit d26da90

40 files changed

+4042
-1056
lines changed

.bumpversion.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ search = __version__ = '{current_version}'
2424
replace = __version__ = '{new_version}'
2525

2626
[bumpversion:file:src/questdb/ingress.pyx]
27-
search = 'v{current_version}'
28-
replace = 'v{new_version}'
27+
search = VERSION = '{current_version}'
28+
replace = VERSION = '{new_version}'

README.rst

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ The latest version of the library is 1.2.0.
2121

2222
::
2323

24-
python3 -m pip install questdb
24+
python3 -m pip install -U questdb
2525

2626
.. code-block:: python
2727
2828
from questdb.ingress import Sender, TimestampNanos
2929
30-
with Sender('localhost', 9009) as sender:
30+
conf = f'http::addr=localhost:9000;'
31+
with Sender.from_conf(conf) as sender:
3132
sender.row(
3233
'sensors',
3334
symbols={'id': 'toronto1'},
@@ -48,10 +49,25 @@ You can also send Pandas dataframes:
4849
'humidity': [0.5, 0.6],
4950
'timestamp': pd.to_datetime(['2021-01-01', '2021-01-02'])})
5051
51-
with Sender('localhost', 9009) as sender:
52+
conf = f'http::addr=localhost:9000;'
53+
with Sender.from_conf(conf) as sender:
5254
sender.dataframe(df, table_name='sensors', at='timestamp')
5355
5456
57+
To connect via TCP, set the
58+
`configuration string <https://py-questdb-client.readthedocs.io/en/latest/conf.html>`_ to:
59+
60+
.. code-block:: python
61+
62+
conf = f'tcp::addr=localhost:9009;'
63+
with Sender.from_conf(conf) as sender:
64+
...
65+
66+
67+
You can continue by reading the
68+
`Sending Data Over ILP <https://py-questdb-client.readthedocs.io/en/latest/sender.html>`_
69+
guide.
70+
5571
Docs
5672
====
5773

c-questdb-client

Submodule c-questdb-client updated 64 files

ci/pip_install_deps.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,28 @@
33
import shlex
44
import textwrap
55
import platform
6+
import argparse
67

78

9+
arg_parser = argparse.ArgumentParser(
10+
prog='pip_install_deps.py',
11+
description='installs dependencies'
12+
)
13+
14+
arg_parser.add_argument('--pandas-version')
15+
816
class UnsupportedDependency(Exception):
917
pass
1018

1119

12-
def pip_install(package):
20+
def pip_install(package, version=None):
1321
args = [
1422
sys.executable,
1523
'-m', 'pip', 'install',
1624
'--upgrade',
1725
'--only-binary', ':all:',
18-
package]
26+
package if version is None else f'{package}=={version}'
27+
]
1928
args_s = ' '.join(shlex.quote(arg) for arg in args)
2029
sys.stderr.write(args_s + '\n')
2130
res = subprocess.run(
@@ -35,9 +44,9 @@ def pip_install(package):
3544
sys.exit(res.returncode)
3645

3746

38-
def try_pip_install(package):
47+
def try_pip_install(package, version=None):
3948
try:
40-
pip_install(package)
49+
pip_install(package, version)
4150
except UnsupportedDependency as e:
4251
msg = textwrap.indent(str(e), ' ' * 8)
4352
sys.stderr.write(f' Ignored unsatisfiable dependency:\n{msg}\n')
@@ -52,12 +61,18 @@ def ensure_timezone():
5261
pip_install('pytz')
5362

5463

55-
def main():
64+
def main(args):
5665
ensure_timezone()
5766
pip_install('pip')
5867
pip_install('setuptools')
5968
try_pip_install('fastparquet>=2023.10.1')
60-
try_pip_install('pandas')
69+
70+
print(f"DEBUG: {args}, pandas: {args.pandas_version}")
71+
72+
if args.pandas_version is not None and args.pandas_version != '':
73+
try_pip_install('pandas', args.pandas_version)
74+
else:
75+
try_pip_install('pandas')
6176
try_pip_install('numpy')
6277
try_pip_install('pyarrow')
6378

@@ -80,4 +95,5 @@ def main():
8095

8196

8297
if __name__ == "__main__":
83-
main()
98+
args = arg_parser.parse_args()
99+
main(args)

ci/run_tests_pipeline.yaml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ stages:
1111
linux:
1212
imageName: "ubuntu-latest"
1313
poolName: "Azure Pipelines"
14+
linux-old-pandas:
15+
imageName: "ubuntu-latest"
16+
poolName: "Azure Pipelines"
17+
pandasVersion: "2.1.4"
18+
linux-qdb-master:
19+
imageName: "ubuntu-latest"
20+
poolName: "Azure Pipelines"
21+
vsQuestDbMaster: true
1422
mac:
1523
imageName: "macos-latest"
1624
poolName: "Azure Pipelines"
@@ -27,14 +35,36 @@ stages:
2735
lfs: false
2836
submodules: true
2937
- task: UsePythonVersion@0
30-
- script: python3 --version
3138
- script: |
39+
python3 --version
3240
python3 -m pip install cython
33-
python3 ci/pip_install_deps.py
34-
displayName: Installing Python dependencies
41+
displayName: "Install cython"
42+
- script: python3 ci/pip_install_deps.py
43+
displayName: "Install pandas latest"
44+
condition: eq(variables.pandasVersion, '')
45+
- script: python3 ci/pip_install_deps.py --pandas-version==$(pandasVersion)
46+
displayName: "Install pandas older"
47+
condition: ne(variables.pandasVersion, '')
3548
- script: python3 proj.py build
3649
displayName: "Build"
50+
- script: |
51+
git clone --depth 1 https://github.com/questdb/questdb.git
52+
displayName: git clone questdb
53+
condition: eq(variables.vsQuestDbMaster, true)
54+
- task: Maven@3
55+
displayName: "Compile QuestDB"
56+
inputs:
57+
mavenPOMFile: 'questdb/pom.xml'
58+
jdkVersionOption: '1.11'
59+
options: "-DskipTests -Pbuild-web-console"
60+
condition: eq(variables.vsQuestDbMaster, true)
61+
- script: python3 proj.py test 1
62+
displayName: "Test vs released"
63+
env:
64+
JAVA_HOME: $(JAVA_HOME_11_X64)
3765
- script: python3 proj.py test 1
38-
displayName: "Test"
66+
displayName: "Test vs master"
3967
env:
4068
JAVA_HOME: $(JAVA_HOME_11_X64)
69+
QDB_REPO_PATH: './questdb'
70+
condition: eq(variables.vsQuestDbMaster, true)

docs/contributing.rst renamed to docs/community.rst

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
============
2-
Contributing
3-
============
1+
=========
2+
Community
3+
=========
4+
5+
Contributions
6+
=============
47

58
Contributions are welcome, and they are greatly appreciated! Every
69
little bit helps, and credit will always be given.
@@ -26,6 +29,21 @@ Development
2629
To get set up for local development follow the
2730
`development notes <https://github.com/questdb/py-questdb-client/blob/main/DEV_NOTES.rst>`_.
2831

32+
Chat to us
33+
==========
34+
2935
If you want to engage with us to discuss your changes or if you need help,
3036
there's a `#contributors` channel on our `slack <http://slack.questdb.io>`_ server
31-
just for that.
37+
just for that.
38+
39+
Asking for help
40+
===============
41+
42+
The best thing to do is to
43+
`ask on Stack Overflow <https://stackoverflow.com/questions/ask?tags=questdb&tags=py-questdb-client>`_.
44+
We monitor the `questdb` tag and will get back to you.
45+
46+
Stack overflow helps us to keep track of the questions and answers, and it helps
47+
other users who might have the same question.
48+
49+
Alternatively, you can ask on our `slack <http://slack.questdb.io>`_ server.

0 commit comments

Comments
 (0)