From dff0e956f9b4cf4ed1927e90bead35d14dd47508 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 08:55:57 +0800 Subject: [PATCH 01/16] fix: support TDengine cloud --- taos/sqlalchemy.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/taos/sqlalchemy.py b/taos/sqlalchemy.py index 170c52e3..81612c94 100644 --- a/taos/sqlalchemy.py +++ b/taos/sqlalchemy.py @@ -486,10 +486,14 @@ def get_indexes(self, connection, table_name, schema=None, **kw): # get database name @reflection.cache def get_schema_names(self, connection, **kw): - sql = "select name from information_schema.ins_databases where `vgroups` is not null" + sql = "show databases" try: cursor = connection.execute(sql) - return [row[0] for row in cursor.fetchall()] + names = [] + for row in cursor.fetchall(): + if self.is_sys_db(row[0]) is False: + names.append[row[0]] + return names except: return [] @@ -498,10 +502,12 @@ def get_schema_names(self, connection, **kw): def get_table_names(self, connection, schema=None, **kw): if schema is None: return [] + # use db + connection.execute(f"use {schema}") # sql sqls = [ - f"select stable_name from information_schema.ins_stables where db_name = '{schema}'", - f"select table_name from information_schema.ins_tables where db_name = '{schema}' and type='NORMAL_TABLE'"] + f"show stables", + f"show normal tables"] # execute try: names = [] From f654bb919bdc33261e13f44cbfc93a6092e076ad Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 09:23:40 +0800 Subject: [PATCH 02/16] fix: websocket use is not right --- taos/sqlalchemy.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/taos/sqlalchemy.py b/taos/sqlalchemy.py index 81612c94..61777401 100644 --- a/taos/sqlalchemy.py +++ b/taos/sqlalchemy.py @@ -492,7 +492,7 @@ def get_schema_names(self, connection, **kw): names = [] for row in cursor.fetchall(): if self.is_sys_db(row[0]) is False: - names.append[row[0]] + names.append(row[0]) return names except: return [] @@ -502,12 +502,10 @@ def get_schema_names(self, connection, **kw): def get_table_names(self, connection, schema=None, **kw): if schema is None: return [] - # use db - connection.execute(f"use {schema}") # sql sqls = [ - f"show stables", - f"show normal tables"] + f"show `{schema}`.stables", + f"show normal `{schema}`.tables"] # execute try: names = [] From b37e18c9ff389e364d3558c9b8ec1cecb6bf8f13 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 09:35:54 +0800 Subject: [PATCH 03/16] feat: support show views --- taos/sqlalchemy.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/taos/sqlalchemy.py b/taos/sqlalchemy.py index 61777401..b0a23fb0 100644 --- a/taos/sqlalchemy.py +++ b/taos/sqlalchemy.py @@ -519,7 +519,22 @@ def get_table_names(self, connection, schema=None, **kw): @reflection.cache def get_view_names(self, connection, schema=None, **kw): - return [] + if schema is None: + return [] + # sql + sqls = [ + f"show `{schema}`.views" + ] + # execute + try: + names = [] + for sql in sqls: + cursor = connection.execute(sql) + for row in cursor.fetchall(): + names.append(row[0]) + return names + except: + return [] def _resolve_type(self, type_): #print(f"call function {sys._getframe().f_code.co_name} type: {type_} ...\n") From f64b7f6bfd672497c682a4da9df7b73592a0fd9b Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 09:47:44 +0800 Subject: [PATCH 04/16] fix: simple code --- taos/sqlalchemy.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/taos/sqlalchemy.py b/taos/sqlalchemy.py index b0a23fb0..4c471b2c 100644 --- a/taos/sqlalchemy.py +++ b/taos/sqlalchemy.py @@ -521,18 +521,13 @@ def get_table_names(self, connection, schema=None, **kw): def get_view_names(self, connection, schema=None, **kw): if schema is None: return [] - # sql - sqls = [ - f"show `{schema}`.views" - ] + # sql + sql = f"show `{schema}`.views" # execute try: - names = [] - for sql in sqls: - cursor = connection.execute(sql) - for row in cursor.fetchall(): - names.append(row[0]) - return names + + cursor = connection.execute(sql) + [row[0] for row in cursor.fetchall() ] except: return [] From 1263500a951a085a3416f3e3be4670a1b1c7eecb Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 09:53:06 +0800 Subject: [PATCH 05/16] fix: view array return --- taos/sqlalchemy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taos/sqlalchemy.py b/taos/sqlalchemy.py index 4c471b2c..42256526 100644 --- a/taos/sqlalchemy.py +++ b/taos/sqlalchemy.py @@ -527,7 +527,7 @@ def get_view_names(self, connection, schema=None, **kw): try: cursor = connection.execute(sql) - [row[0] for row in cursor.fetchall() ] + return [row[0] for row in cursor.fetchall() ] except: return [] From 48387144cfee899fa3e33b7740ee322ab44fe4cb Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 17:03:34 +0800 Subject: [PATCH 06/16] fix: add CLOUD_DSN replace plain text --- .github/workflows/test-ubuntu-2004.yml | 6 + CHANGELOG.md | 175 ------------------------- taos-ws-py/CHANGELOG.md | 14 -- taos-ws-py/tests/test_cloud.py | 14 +- 4 files changed, 17 insertions(+), 192 deletions(-) diff --git a/.github/workflows/test-ubuntu-2004.yml b/.github/workflows/test-ubuntu-2004.yml index 364935b7..b7d1342b 100644 --- a/.github/workflows/test-ubuntu-2004.yml +++ b/.github/workflows/test-ubuntu-2004.yml @@ -87,6 +87,10 @@ jobs: - name: Build TDengine 3.0 run: | + echo ${{ secrets.CLOUD_TOKEN }} + export CLOUD_DSN=${{screcrset.CLOUD_TOKEN}} + echo $CLOUD_DSN + cd TDengine_v3 mkdir build cd build @@ -113,6 +117,8 @@ jobs: - name: Test 3.0 run: | export LD_LIBRARY_PATH=$PWD/TDengine_v3/build/build/lib + export CLOUD_DSN=${{screcrset.CLOUD_TOKEN}} + echo $CLOUD_DSN #source $VENV export TDENGINE_URL=localhost:6041 curl -L -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" -d "show databases" localhost:6041/rest/sql diff --git a/CHANGELOG.md b/CHANGELOG.md index 7496b410..9cbb4647 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,181 +61,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - optimize taospy documents on PyPi official website -## v2.7.17 - 2024-12-14 - -### Features: - -- support taos taosws taosrest protocol for superset - -### Bug Fixes: - -- 2.x add taos-ws-py compose -- DATABASE_URL KeyError -- add pip3 install ./ -- add report Codecov.io with token -- add report Codecov.io with token1 -- case test_tmp death wait message -- change dotenv name -- ci test passed -- coverage with pytest run -- dotenv remove install -- forbid test_tmp.py case -- if v3 return for taosw -- insert test_sqlalchemy.py ok -- insert with conn do -- insertData is inner testfun -- move import taosws to fun -- need insert data before checkBasic for sqlalcmy -- need install taos-ws-py -- no poetry install need module -- only run pytest tet -- reduce insert data -- remove other test function -- remove pytest coverage -- rest test already in test_sqlalchemy.py -- restore all case -- restore pytest coverage -- restore test_tmq.py case -- setup superset driverTDengine.py to package -- test with rest and taosc -- ubuntu20.4 remove poetry run -- use text -- version from 2.7.16 to 2.7.17 -- **(taos-ws-py)**: fix crypto provider error - -### Enhancements: - -- double match to sqltypes.float reference sqlite rule - -### Tests: - -- do nothing for tmp and sqlalchemy - -### Documents: - -- optimize taospy documents on PyPi official website - -## v2.7.17 - 2024-12-14 - -### Features: - -- support taos taosws taosrest protocol for superset - -### Bug Fixes: - -- 2.x add taos-ws-py compose -- DATABASE_URL KeyError -- add pip3 install ./ -- add report Codecov.io with token -- add report Codecov.io with token1 -- case test_tmp death wait message -- change dotenv name -- ci test passed -- coverage with pytest run -- dotenv remove install -- forbid test_tmp.py case -- if v3 return for taosw -- insert test_sqlalchemy.py ok -- insert with conn do -- insertData is inner testfun -- move import taosws to fun -- need insert data before checkBasic for sqlalcmy -- need install taos-ws-py -- no poetry install need module -- only run pytest tet -- reduce insert data -- remove other test function -- remove pytest coverage -- rest test already in test_sqlalchemy.py -- restore all case -- restore pytest coverage -- restore test_tmq.py case -- setup superset driverTDengine.py to package -- test with rest and taosc -- ubuntu20.4 remove poetry run -- use text -- version from 2.7.16 to 2.7.17 -- **(taos-ws-py)**: fix crypto provider error - -### Enhancements: - -- double match to sqltypes.float reference sqlite rule - -### Tests: - -- do nothing for tmp and sqlalchemy - -### Documents: - -- optimize taospy documents on PyPi official website - -## v2.7.17 - 2024-12-14 - -## v2.7.17 - 2024-12-14 - -### Features: - -- support taos taosws taosrest protocol for superset - -### Bug Fixes: - -- 2.x add taos-ws-py compose -- DATABASE_URL KeyError -- add pip3 install ./ -- add report Codecov.io with token -- add report Codecov.io with token1 -- case test_tmp death wait message -- change dotenv name -- ci test passed -- coverage with pytest run -- dotenv remove install -- forbid test_tmp.py case -- if v3 return for taosw -- insert test_sqlalchemy.py ok -- insert with conn do -- insertData is inner testfun -- move import taosws to fun -- need insert data before checkBasic for sqlalcmy -- need install taos-ws-py -- no poetry install need module -- only run pytest tet -- reduce insert data -- remove other test function -- remove pytest coverage -- rest test already in test_sqlalchemy.py -- restore all case -- restore pytest coverage -- restore test_tmq.py case -- setup superset driverTDengine.py to package -- test with rest and taosc -- ubuntu20.4 remove poetry run -- use text -- version from 2.7.16 to 2.7.17 -- **(taos-ws-py)**: fix crypto provider error - -### Enhancements: - -- double match to sqltypes.float reference sqlite rule - -### Tests: - -- do nothing for tmp and sqlalchemy - -### Documents: - -- optimize taospy documents on PyPi official website - -## v2.7.17 - 2024-12-13 - -### New Feature -- Support Apache-SuperSet BI Tools - -## v2.7.16 - 2024-09-19 - -## v2.7.15 - 2024-04-12 - -## v2.7.14 - 2024-04-12 - ## v2.7.13 - 2024-01-26 ### Bug Fixes: diff --git a/taos-ws-py/CHANGELOG.md b/taos-ws-py/CHANGELOG.md index 62394bb1..b64d7919 100644 --- a/taos-ws-py/CHANGELOG.md +++ b/taos-ws-py/CHANGELOG.md @@ -5,20 +5,6 @@ All notable changes to this project will be documented in this file. The format is based on [Conventional Changelog](https://www.conventionalcommits.org/en/v1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## v0.2.2 - 2023-01-13 - -## v0.3.4 - 2024-11-19 - -## v0.3.4 - 2024-11-19 - -## v0.3.4 - 2024-11-19 - -## v0.3.4 - 2024-11-19 - -## v0.3.4 - 2024-11-19 - -## v0.3.4 - 2024-11-19 - ## v0.3.4 - 2024-11-19 ## v0.3.3 - 2024-09-19 diff --git a/taos-ws-py/tests/test_cloud.py b/taos-ws-py/tests/test_cloud.py index b9e81f08..e104a46b 100644 --- a/taos-ws-py/tests/test_cloud.py +++ b/taos-ws-py/tests/test_cloud.py @@ -1,11 +1,19 @@ +import os import taosws def test_ws_connect(): print("-" * 40) print("test_ws_connect") - conn = taosws.connect("%s?token=%s" % ('wss://gw.cloud.taosdata.com', '68d41c020d2e9e3dcac18140460d1bcfd82d642d')) - r = conn.query_with_req_id("show dnodes", 1) - print("r: ", r.fields) + # get evn + token = os.environ.get("CLOUD_TOKEN") + print(token) + conn = taosws.connect("%s?token=%s" % ('wss://gw.cloud.taosdata.com', token)) + res = conn.query_with_req_id("show databases", 1) + print(res) + dbs = [row[0] for row in res] + # check sys db exist + assert "information_schema" in dbs + assert "performance_schema" in dbs print("test_ws_connect done") print("-" * 40) From 2b46d6cbdbcc86ebca6cee27d1ded2abb1edcf2e Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 17:17:50 +0800 Subject: [PATCH 07/16] fix: add token --- .github/workflows/test-ubuntu-2004.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-ubuntu-2004.yml b/.github/workflows/test-ubuntu-2004.yml index b7d1342b..b3ff85f3 100644 --- a/.github/workflows/test-ubuntu-2004.yml +++ b/.github/workflows/test-ubuntu-2004.yml @@ -86,9 +86,10 @@ jobs: ref: ${{ steps.determine-branch.outputs.value }} - name: Build TDengine 3.0 + env: + CLOUD_DSN:${{secrets.CLOUD_TOKEN}} run: | echo ${{ secrets.CLOUD_TOKEN }} - export CLOUD_DSN=${{screcrset.CLOUD_TOKEN}} echo $CLOUD_DSN cd TDengine_v3 @@ -117,7 +118,6 @@ jobs: - name: Test 3.0 run: | export LD_LIBRARY_PATH=$PWD/TDengine_v3/build/build/lib - export CLOUD_DSN=${{screcrset.CLOUD_TOKEN}} echo $CLOUD_DSN #source $VENV export TDENGINE_URL=localhost:6041 From 521d1cbe5dddc2982c369325326c7b9e0e205475 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 21:25:14 +0800 Subject: [PATCH 08/16] fix: add token cloud --- .github/workflows/test-ubuntu-2004.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-ubuntu-2004.yml b/.github/workflows/test-ubuntu-2004.yml index b3ff85f3..8da980ac 100644 --- a/.github/workflows/test-ubuntu-2004.yml +++ b/.github/workflows/test-ubuntu-2004.yml @@ -86,8 +86,6 @@ jobs: ref: ${{ steps.determine-branch.outputs.value }} - name: Build TDengine 3.0 - env: - CLOUD_DSN:${{secrets.CLOUD_TOKEN}} run: | echo ${{ secrets.CLOUD_TOKEN }} echo $CLOUD_DSN From bcabf497f31e3e9d72cc495ff967b202c2d1661d Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 21:46:52 +0800 Subject: [PATCH 09/16] fix: add mac build go --- .github/workflows/mac.yml | 28 ++++++++++++++++++++++++++ .github/workflows/test-ubuntu-2004.yml | 11 +++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 5a574101..55dd4c72 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -81,6 +81,34 @@ jobs: (github.event_name == 'push' && steps.cache-server-push.outputs.cache-hit != 'true') run: brew install argp-standalone pkgconfig geos + - name: Set up homebrew + if: | + github.event_name == 'pull_request' + || github.event_name == 'push' + || github.event_name == 'schedule' + run: | + brew update + brew install --overwrite argp-standalone pkg-config + brew info argp-standalone + + - name: Set up Go + if: | + github.event_name == 'pull_request' + || github.event_name == 'push' + || github.event_name == 'schedule' + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - name: Set up Rust + if: | + github.event_name == 'pull_request' + || github.event_name == 'push' + || github.event_name == 'schedule' + uses: actions-rs/toolchain@v1.0.6 + with: + toolchain: stable + - name: install TDengine if: > (github.event_name == 'workflow_dispatch' && steps.cache-server-manually.outputs.cache-hit != 'true') || diff --git a/.github/workflows/test-ubuntu-2004.yml b/.github/workflows/test-ubuntu-2004.yml index 8da980ac..2e85dab9 100644 --- a/.github/workflows/test-ubuntu-2004.yml +++ b/.github/workflows/test-ubuntu-2004.yml @@ -87,8 +87,8 @@ jobs: - name: Build TDengine 3.0 run: | - echo ${{ secrets.CLOUD_TOKEN }} - echo $CLOUD_DSN + export CLOUD_DSN=${{ secrets.CLOUD_TOKEN }} + echo "dsn=$CLOUD_DSN" cd TDengine_v3 mkdir build @@ -116,7 +116,12 @@ jobs: - name: Test 3.0 run: | export LD_LIBRARY_PATH=$PWD/TDengine_v3/build/build/lib - echo $CLOUD_DSN + export CLOUD_DSN=${{ secrets.CLOUD_TOKEN }} + echo "dsn=$CLOUD_DSN" + pytest taos-ws-py/tests/test_cloud.py + + echo "---------- test end for test_cloud.py -------------" + #source $VENV export TDENGINE_URL=localhost:6041 curl -L -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" -d "show databases" localhost:6041/rest/sql From 219c90d06e1e01c987d8f5a9fc0697c9e77fe650 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 23:25:52 +0800 Subject: [PATCH 10/16] fix: add pytest --- .github/workflows/test-ubuntu-2004.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-ubuntu-2004.yml b/.github/workflows/test-ubuntu-2004.yml index 2e85dab9..c7a4f1f3 100644 --- a/.github/workflows/test-ubuntu-2004.yml +++ b/.github/workflows/test-ubuntu-2004.yml @@ -116,16 +116,16 @@ jobs: - name: Test 3.0 run: | export LD_LIBRARY_PATH=$PWD/TDengine_v3/build/build/lib - export CLOUD_DSN=${{ secrets.CLOUD_TOKEN }} - echo "dsn=$CLOUD_DSN" - pytest taos-ws-py/tests/test_cloud.py echo "---------- test end for test_cloud.py -------------" #source $VENV export TDENGINE_URL=localhost:6041 curl -L -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" -d "show databases" localhost:6041/rest/sql + export CLOUD_DSN=${{ secrets.CLOUD_TOKEN }} + echo "dsn=$CLOUD_DSN" poetry run pip install psutil pandas pytest-cov "numpy<2.0.0" + poetry run pytest taos-ws-py/tests/test_cloud.py poetry run pytest --cov-report term --cov-report html --cov-report xml --cov=taos --cov=taosrest --cov-append tests From 07d778172647284e7ec00770912de8dba4f2b7b6 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 21 Dec 2024 23:54:16 +0800 Subject: [PATCH 11/16] fix: add pip install taos-ws-py --- .github/workflows/test-ubuntu-2004.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-ubuntu-2004.yml b/.github/workflows/test-ubuntu-2004.yml index c7a4f1f3..9a2639a6 100644 --- a/.github/workflows/test-ubuntu-2004.yml +++ b/.github/workflows/test-ubuntu-2004.yml @@ -124,7 +124,7 @@ jobs: curl -L -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" -d "show databases" localhost:6041/rest/sql export CLOUD_DSN=${{ secrets.CLOUD_TOKEN }} echo "dsn=$CLOUD_DSN" - poetry run pip install psutil pandas pytest-cov "numpy<2.0.0" + poetry run pip install psutil pandas pytest-cov "numpy<2.0.0" taos-ws-py poetry run pytest taos-ws-py/tests/test_cloud.py poetry run pytest --cov-report term --cov-report html --cov-report xml --cov=taos --cov=taosrest --cov-append tests From fcfa1b78c125b3f86ccded81213ce2d7317c55a2 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sun, 22 Dec 2024 10:50:48 +0800 Subject: [PATCH 12/16] test: token pass with argument --- .github/workflows/test-ubuntu-2004.yml | 2 +- taos-ws-py/tests/test_cloud.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-ubuntu-2004.yml b/.github/workflows/test-ubuntu-2004.yml index 9a2639a6..0ef9af91 100644 --- a/.github/workflows/test-ubuntu-2004.yml +++ b/.github/workflows/test-ubuntu-2004.yml @@ -125,7 +125,7 @@ jobs: export CLOUD_DSN=${{ secrets.CLOUD_TOKEN }} echo "dsn=$CLOUD_DSN" poetry run pip install psutil pandas pytest-cov "numpy<2.0.0" taos-ws-py - poetry run pytest taos-ws-py/tests/test_cloud.py + poetry run python3 taos-ws-py/tests/test_cloud.py ${{ secrets.CLOUD_TOKEN }} poetry run pytest --cov-report term --cov-report html --cov-report xml --cov=taos --cov=taosrest --cov-append tests diff --git a/taos-ws-py/tests/test_cloud.py b/taos-ws-py/tests/test_cloud.py index e104a46b..f3164d87 100644 --- a/taos-ws-py/tests/test_cloud.py +++ b/taos-ws-py/tests/test_cloud.py @@ -1,16 +1,17 @@ import os +import sys import taosws -def test_ws_connect(): +def test_ws_connect(token): print("-" * 40) print("test_ws_connect") # get evn - token = os.environ.get("CLOUD_TOKEN") + #token = os.environ.get("CLOUD_TOKEN") print(token) conn = taosws.connect("%s?token=%s" % ('wss://gw.cloud.taosdata.com', token)) res = conn.query_with_req_id("show databases", 1) - print(res) dbs = [row[0] for row in res] + print(dbs) # check sys db exist assert "information_schema" in dbs assert "performance_schema" in dbs @@ -18,4 +19,7 @@ def test_ws_connect(): print("-" * 40) if __name__ == "__main__": - test_ws_connect() + if len(sys.argv) == 0: + print("need token argument passed.\n") + else: + test_ws_connect(sys.argv[0]) \ No newline at end of file From dbf08a12b890f55b271ae88e0e49b7453861f1eb Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sun, 22 Dec 2024 10:52:17 +0800 Subject: [PATCH 13/16] test: token pass with argument index 1 --- taos-ws-py/tests/test_cloud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taos-ws-py/tests/test_cloud.py b/taos-ws-py/tests/test_cloud.py index f3164d87..c4fc1a6f 100644 --- a/taos-ws-py/tests/test_cloud.py +++ b/taos-ws-py/tests/test_cloud.py @@ -19,7 +19,7 @@ def test_ws_connect(token): print("-" * 40) if __name__ == "__main__": - if len(sys.argv) == 0: + if len(sys.argv) < 2 : print("need token argument passed.\n") else: - test_ws_connect(sys.argv[0]) \ No newline at end of file + test_ws_connect(sys.argv[1]) \ No newline at end of file From 774244987c037200a14de54884788e5e2be1fc86 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sun, 22 Dec 2024 12:16:44 +0800 Subject: [PATCH 14/16] fix: remove test_cloud.py test in example test --- .github/workflows/test-ubuntu-2004.yml | 12 +++++------- taos-ws-py/tests/test_cloud.py | 7 ++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-ubuntu-2004.yml b/.github/workflows/test-ubuntu-2004.yml index 0ef9af91..16e5b580 100644 --- a/.github/workflows/test-ubuntu-2004.yml +++ b/.github/workflows/test-ubuntu-2004.yml @@ -122,19 +122,17 @@ jobs: #source $VENV export TDENGINE_URL=localhost:6041 curl -L -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" -d "show databases" localhost:6041/rest/sql - export CLOUD_DSN=${{ secrets.CLOUD_TOKEN }} - echo "dsn=$CLOUD_DSN" - poetry run pip install psutil pandas pytest-cov "numpy<2.0.0" taos-ws-py - poetry run python3 taos-ws-py/tests/test_cloud.py ${{ secrets.CLOUD_TOKEN }} + poetry run pip install psutil pandas pytest-cov "numpy<2.0.0" poetry run pytest --cov-report term --cov-report html --cov-report xml --cov=taos --cov=taosrest --cov-append tests - name: Test examples 3.0 - run: | - cd examples || ls -l - pip3 install .. > /dev/null || echo "failed to install taospy from source code" + run: | + pip3 install ./ > /dev/null || echo "failed to install taospy from source code" pip3 install taos-ws-py > /dev/null || echo "failed to install taos-ws-py" pip3 install pandas "numpy<2.0.0" sqlalchemy > /dev/null || echo "failed to install pandas" + python3 taos-ws-py/tests/test_cloud.py ${{ secrets.CLOUD_TOKEN }} + cd examples || ls -l taosBenchmark -d power -t 10 -n 10 -y for i in `find . -name "*.py" \ |grep -Ev "cloud|trades|v2|websocket_with_req_id|tmq_consumer|rest_cursor|rest_client.py|import-json|connect_rest_examples|schemaless_insert"`; \ diff --git a/taos-ws-py/tests/test_cloud.py b/taos-ws-py/tests/test_cloud.py index c4fc1a6f..aa404d4c 100644 --- a/taos-ws-py/tests/test_cloud.py +++ b/taos-ws-py/tests/test_cloud.py @@ -2,12 +2,9 @@ import sys import taosws -def test_ws_connect(token): +def taos_ws_connect(token): print("-" * 40) print("test_ws_connect") - # get evn - #token = os.environ.get("CLOUD_TOKEN") - print(token) conn = taosws.connect("%s?token=%s" % ('wss://gw.cloud.taosdata.com', token)) res = conn.query_with_req_id("show databases", 1) dbs = [row[0] for row in res] @@ -22,4 +19,4 @@ def test_ws_connect(token): if len(sys.argv) < 2 : print("need token argument passed.\n") else: - test_ws_connect(sys.argv[1]) \ No newline at end of file + taos_ws_connect(sys.argv[1]) \ No newline at end of file From 5e16aa3e7b505abc1953493c66ca9759801615f3 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 23 Dec 2024 14:36:21 +0800 Subject: [PATCH 15/16] docs: 2.7.18 modify bug fixed log --- CHANGELOG.md | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cbb4647..a4055220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,38 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug Fixes: -- 2.x add taos-ws-py compose -- DATABASE_URL KeyError -- add pip3 install ./ -- add report Codecov.io with token -- add report Codecov.io with token1 -- case test_tmp death wait message -- change dotenv name -- ci test passed -- coverage with pytest run -- dotenv remove install -- forbid test_tmp.py case -- if v3 return for taosw -- insert test_sqlalchemy.py ok -- insert with conn do -- insertData is inner testfun -- move import taosws to fun -- need insert data before checkBasic for sqlalcmy -- need install taos-ws-py -- no poetry install need module -- only run pytest tet -- reduce insert data -- remove other test function -- remove pytest coverage -- rest test already in test_sqlalchemy.py -- restore all case -- restore pytest coverage -- restore test_tmq.py case -- setup superset driverTDengine.py to package -- test with rest and taosc -- ubuntu20.4 remove poetry run -- use text -- version from 2.7.16 to 2.7.17 +- fix: case test_tmp death wait message - **(taos-ws-py)**: fix crypto provider error ### Enhancements: From 4908e9e7d42400a77d14f437ad67f0d1144c15da Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 23 Dec 2024 16:43:14 +0800 Subject: [PATCH 16/16] docs: rewrite changelog with offical-website doc --- CHANGELOG.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4055220..ecf70e8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - optimize taospy documents on PyPi official website +## v2.7.16 - 2024-09-19 + +### Features: + +- Add subscription configuration (session. timeout. ms, Max. roll. interval. ms). + +## v2.7.15 - 2024-04-12 + +### Features: + +- Added support for VARBINRY and GEOMETRY types. + +## v2.7.14 - 2024-04-12 + +### Bug Fixes: + +- Fix Known Issues. + ## v2.7.13 - 2024-01-26 ### Bug Fixes: @@ -111,8 +129,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - update cmd - update readme -## v2.7.7 - 2023-03-29 - ## v2.7.7 - 2023-03-28 ### Bug Fixes: