Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
280398c
feat: add connect property setting function to native connector
menshibin May 12, 2025
aa7d13f
feat: add options connection case
menshibin May 22, 2025
933a61e
feat: add options connection case
menshibin May 22, 2025
062cc39
feat: modify options connection case for ci test
menshibin May 22, 2025
456c79d
feat: adjust options connection case param for ci test
menshibin May 22, 2025
0ccd09a
feat: modify options connection case check
menshibin May 22, 2025
7fb6d8e
fix: delete libtaos.so version
menshibin May 22, 2025
f0723ae
feat: modify mac yml for ci test
menshibin May 22, 2025
f7fd5ba
test: modify mac.yml print lib dir
menshibin May 22, 2025
a07eca6
feat: delete libtaos ln
menshibin May 22, 2025
6e59efc
Merge branch 'feat/TD-34747' of github.com:taosdata/taos-connector-py…
menshibin May 22, 2025
49ac9bf
feat: add ci test command
menshibin May 22, 2025
2f344f5
feat: add ci test env info print
menshibin May 22, 2025
f3f244a
feat: modify mac.yml for print test
menshibin May 22, 2025
0087810
feat: modify libtaos path for test
menshibin May 22, 2025
6014b06
feat: Delete incorrect soft connections
menshibin May 22, 2025
876bcde
feat: modify adapter soft connections
menshibin May 22, 2025
3e459fb
feat: clear libtaos
menshibin May 22, 2025
aebace9
feat: modify spell error
menshibin May 22, 2025
3471632
feat: add local lib dir print
menshibin May 22, 2025
aed15ad
feat: modify soft link shell
menshibin May 22, 2025
1c0f92c
feat: modify taosc soft link for taosadapter
menshibin May 23, 2025
159d47a
feat: delete test code
menshibin May 23, 2025
d84b72f
feat: restore connector parameters
menshibin May 23, 2025
a899325
feat: put the options/mode settings to connect() parameters
menshibin May 23, 2025
f01745a
feat: rename TSDB_OPTION_CONNECTION
menshibin May 23, 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
26 changes: 15 additions & 11 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
|| github.event_name == 'schedule'
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: stable

- name: Set up Rust
if: |
Expand Down Expand Up @@ -138,23 +138,24 @@ jobs:
cp ./TDengine/debug/build/bin/taos ./release/
cp ./TDengine/debug/build/bin/taosd ./release/
cp ./TDengine/debug/build/bin/taosadapter ./release/
cp ./TDengine/debug/build/lib/libtaos.3.9.9.9.dylib ./release/
cp ./TDengine/debug/build/lib/libtaosnative.3.9.9.9.dylib ./release/
cp ./TDengine/debug/build/lib/libtaos.dylib ./release/
cp ./TDengine/debug/build/lib/libtaosnative.dylib ./release/
cp ./TDengine/include/client/taos.h ./release/
cat >./release/install.sh<<EOF
echo "-------------"
ls -l /usr/local/lib/
chmod +x ./taos
chmod +x ./taosd
chmod +x ./taosadapter
cp ./taos /usr/local/bin
cp ./taosd /usr/local/bin
cp ./taosadapter /usr/local/bin
cp ./libtaos.3.9.9.9.dylib /usr/local/lib
ln -sfv /usr/local/lib/libtaos.3.9.9.9.dylib /usr/local/lib/libtaos.1.dylib
ln -sfv /usr/local/lib/libtaos.1.dylib /usr/local/lib/libtaos.dylib
cp ./libtaosnative.3.9.9.9.dylib /usr/local/lib
ln -sfv /usr/local/lib/libtaosnative.3.9.9.9.dylib /usr/local/lib/libtaosnative.1.dylib
ln -sfv /usr/local/lib/libtaosnative.1.dylib /usr/local/lib/libtaosnative.dylib
sudo rm -rf /usr/local/lib/libtaos*
cp ./libtaos.dylib /usr/local/lib
cp ./libtaosnative.dylib /usr/local/lib
cp ./taos.h /usr/local/include
ls -l /usr/local/lib/
echo "!-------------!"
EOF
tar -zcvf server.tar.gz ./release

Expand Down Expand Up @@ -358,8 +359,8 @@ jobs:
run: |
pwd
mkdir -p TDengine/debug/build/lib
ln -sfv /usr/local/lib/libtaos.1.dylib TDengine/debug/build/lib/libtaos.1.dylib
ln -sfv /usr/local/lib/libtaosnative.1.dylib TDengine/debug/build/lib/libtaosnative.1.dylib
ln -sfv /usr/local/lib/libtaos.dylib TDengine/debug/build/lib/libtaos.dylib
ln -sfv /usr/local/lib/libtaosnative.dylib TDengine/debug/build/lib/libtaosnative.dylib
ls -l TDengine/debug/build/lib/
sudo taosadapter &

Expand All @@ -372,7 +373,10 @@ jobs:
run: |
source $VENV
export TDENGINE_URL=localhost:6041
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
ls -l /usr/local/lib
ps aux | grep taos
python -c "import ctypes; print(ctypes.CDLL('/usr/local/lib/libtaos.dylib'))"
poetry run pip install psutil pandas "numpy<2.0.0" shapely
poetry run pytest tests

Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## v2.8.1 - 2025-05-22

### Features:

- add connect property setting function to native connector

### Bug Fixes:

- all workflows cmake config
- delete token auth
- modify version to 2.8.0
- optimize null value checks (#317)
- password supports special characters
- remove superset driver TDengine.py
- test auth base64
- uniform python name
- workflows cmake config
- **(ws)**: update Cargo.lock

### Documents:

- add changelog for v2.7.22/v2.7.23
- python to Python

## v2.7.23 - 2025-03-24
- support DECIMAL data type

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "taospy"
version = "2.8.0"
version = "2.8.1"
description = "The official TDengine Python connector"
authors = ["Taosdata Inc. <support@taosdata.com>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion taos/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.8.0'
__version__ = '2.8.1'
10 changes: 10 additions & 0 deletions taos/cinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ def taos_options(option, value):
_value = c_char_p(value.encode("utf-8"))
_libtaos.taos_options(option, _value)

def taos_options_connection(connection, option, value):
_value = c_char_p(value.encode("utf-8"))
res = _libtaos.taos_options_connection(connection, option, _value)
if res != 0:
raise DatabaseError("taos_options_connection error", res)

def taos_set_conn_mode(connection, mode, value):
res = _libtaos.taos_set_conn_mode(connection, mode, value)
if res != 0:
raise DatabaseError("taos_set_conn_mode error", res)

def taos_init():
# type: () -> None
Expand Down
6 changes: 6 additions & 0 deletions taos/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ def server_info(self):
# type: () -> str
return taos_get_server_info(self._conn)

def options_connection(self, option, value):
Comment thread
menshibin marked this conversation as resolved.
Outdated
taos_options_connection(self._conn, option, value)

def set_conn_mode(self, mode, value):
Comment thread
menshibin marked this conversation as resolved.
Outdated
taos_set_conn_mode(self._conn, mode, value)

def select_db(self, database):
# type: (str) -> None
taos_select_db(self._conn, database)
Expand Down
29 changes: 28 additions & 1 deletion tests/test_connect_args.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from taos import *

import time

def test_connect_args():
"""
Expand All @@ -8,7 +8,34 @@ def test_connect_args():
Useless args, prevent mistakenly deleted args in connect init.
Because some case in CI of earlier version may use it.
"""

host = "localhost:6030"
conn = connect(host)
conn.options_connection(0, "utf8")
conn.options_connection(1, "UTC")
Comment thread
menshibin marked this conversation as resolved.
Outdated
conn.options_connection(2, "127.0.0.2")
conn.options_connection(3, "python client")
conn.set_conn_mode(0, 1)

time.sleep(30)
bClient = False
bHost = False
result = conn.query("show connections")
assert result is not None
for row in result:
print(row)
if row[7] == "python client":
bClient = True
if row[8] == "127.0.0.2":
bHost = True

assert bClient and bHost

result = conn.query("select timezone()")
assert result is not None
for row in result:
print(row)
assert row[0] == "UTC (UTC, +0000)"

assert conn is not None
conn.close()
Loading