apache-iotdb 1.3.2__py3-none-any.whl → 1.3.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {apache_iotdb-1.3.2.dist-info → apache_iotdb-1.3.3.dist-info}/METADATA +15 -103
  2. {apache_iotdb-1.3.2.dist-info → apache_iotdb-1.3.3.dist-info}/RECORD +31 -29
  3. {apache_iotdb-1.3.2.dist-info → apache_iotdb-1.3.3.dist-info}/WHEEL +1 -1
  4. iotdb/Session.py +98 -0
  5. iotdb/template/MeasurementNode.py +10 -0
  6. iotdb/template/Template.py +8 -0
  7. iotdb/template/TemplateNode.py +8 -0
  8. iotdb/thrift/common/ttypes.py +1295 -212
  9. iotdb/tsfile/utils/DateUtils.py +41 -0
  10. iotdb/utils/Field.py +43 -7
  11. iotdb/utils/IoTDBConstants.py +10 -1
  12. iotdb/utils/IoTDBRpcDataSet.py +69 -22
  13. iotdb/utils/NumpyTablet.py +27 -6
  14. iotdb/utils/RowRecord.py +2 -6
  15. iotdb/utils/SessionDataSet.py +14 -10
  16. iotdb/utils/Tablet.py +30 -14
  17. iotdb/template/InternalNode.py → tests/integration/__init__.py +0 -24
  18. tests/integration/test_new_data_types.py +184 -0
  19. tests/{test_todf.py → integration/test_todf.py} +3 -3
  20. tests/unit/__init__.py +17 -0
  21. tests/test_template.py +0 -110
  22. {apache_iotdb-1.3.2.dist-info → apache_iotdb-1.3.3.dist-info}/entry_points.txt +0 -0
  23. {apache_iotdb-1.3.2.dist-info → apache_iotdb-1.3.3.dist-info}/top_level.txt +0 -0
  24. /tests/{tablet_performance_comparison.py → integration/tablet_performance_comparison.py} +0 -0
  25. /tests/{test_aligned_timeseries.py → integration/test_aligned_timeseries.py} +0 -0
  26. /tests/{test_dataframe.py → integration/test_dataframe.py} +0 -0
  27. /tests/{test_delete_data.py → integration/test_delete_data.py} +0 -0
  28. /tests/{test_one_device.py → integration/test_one_device.py} +0 -0
  29. /tests/{test_session.py → integration/test_session.py} +0 -0
  30. /tests/{test_session_pool.py → integration/test_session_pool.py} +0 -0
  31. /tests/{test_tablet.py → integration/test_tablet.py} +0 -0
  32. /tests/{test_numpy_tablet.py → unit/test_numpy_tablet.py} +0 -0
@@ -1,23 +1,24 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-iotdb
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: Apache IoTDB client API
5
- Home-page: https://github.com/apache/iotdb
6
- Author: Apache Software Foundation
7
- Author-email: dev@iotdb.apache.org
5
+ Author-email: Apache IoTDB <dev@iotdb.apache.org>
8
6
  License: Apache License, Version 2.0
7
+ Project-URL: Homepage, https://iotdb.apache.org
8
+ Project-URL: Documentation, https://github.com/apache/iotdb
9
+ Keywords: iotdb,apache,client,API
9
10
  Classifier: Programming Language :: Python :: 3
10
11
  Classifier: License :: OSI Approved :: Apache Software License
11
12
  Classifier: Operating System :: OS Independent
12
13
  Classifier: Topic :: Software Development :: Libraries
13
14
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
- Requires-Python: >=3.7
15
+ Requires-Python: >=3.6
15
16
  Description-Content-Type: text/markdown
16
- Requires-Dist: thrift >=0.14.1
17
- Requires-Dist: pandas >=1.3.5
18
- Requires-Dist: numpy >=1.21.4
19
- Requires-Dist: sqlalchemy <1.5,>=1.4
20
- Requires-Dist: sqlalchemy-utils >=0.37.8
17
+ Requires-Dist: thrift>=0.14.1
18
+ Requires-Dist: pandas>=1.0.0
19
+ Requires-Dist: numpy>=1.0.0
20
+ Requires-Dist: sqlalchemy<1.5,>=1.4
21
+ Requires-Dist: sqlalchemy-utils>=0.37.8
21
22
 
22
23
  <!--
23
24
 
@@ -42,7 +43,6 @@ Requires-Dist: sqlalchemy-utils >=0.37.8
42
43
 
43
44
  # Apache IoTDB
44
45
 
45
- [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml)
46
46
  [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases)
47
47
  [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
48
48
  ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg)
@@ -61,7 +61,7 @@ high-speed data ingestion and complex data analysis in the IoT industrial fields
61
61
 
62
62
  ### Requirements
63
63
 
64
- You have to install thrift (>=0.13) before using the package.
64
+ You have to install thrift (>=0.14.1) before using the package.
65
65
 
66
66
 
67
67
 
@@ -69,8 +69,6 @@ You have to install thrift (>=0.13) before using the package.
69
69
 
70
70
  First, download the latest package: `pip3 install apache-iotdb`
71
71
 
72
- *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!*
73
-
74
72
  You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py)
75
73
 
76
74
  An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py)
@@ -333,91 +331,6 @@ session.execute_non_query_statement(sql)
333
331
  session.execute_statement(sql)
334
332
  ```
335
333
 
336
- ### Device Template
337
- #### Create Device Template
338
- The step for creating a metadata template is as follows
339
- 1. Create the template class
340
- 2. Adding child Node,InternalNode and MeasurementNode can be chose
341
- 3. Execute create device template function
342
-
343
- ```python
344
- template = Template(name=template_name, share_time=True)
345
-
346
- i_node_gps = InternalNode(name="GPS", share_time=False)
347
- i_node_v = InternalNode(name="vehicle", share_time=True)
348
- m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY)
349
-
350
- i_node_gps.add_child(m_node_x)
351
- i_node_v.add_child(m_node_x)
352
-
353
- template.add_template(i_node_gps)
354
- template.add_template(i_node_v)
355
- template.add_template(m_node_x)
356
-
357
- session.create_schema_template(template)
358
- ```
359
- #### Modify Device Template nodes
360
- Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes.
361
- * add node in template
362
- ```python
363
- session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned)
364
- ```
365
-
366
- * delete node in template
367
- ```python
368
- session.delete_node_in_template(template_name, path)
369
- ```
370
-
371
- #### Set Device Template
372
- ```python
373
- session.set_schema_template(template_name, prefix_path)
374
- ```
375
-
376
- #### Uset Device Template
377
- ```python
378
- session.unset_schema_template(template_name, prefix_path)
379
- ```
380
-
381
- #### Show Device Template
382
- * Show all device templates
383
- ```python
384
- session.show_all_templates()
385
- ```
386
- * Count all nodes in templates
387
- ```python
388
- session.count_measurements_in_template(template_name)
389
- ```
390
-
391
- * Judge whether the path is measurement or not in templates, This measurement must be in the template
392
- ```python
393
- session.count_measurements_in_template(template_name, path)
394
- ```
395
-
396
- * Judge whether the path is exist or not in templates, This path may not belong to the template
397
- ```python
398
- session.is_path_exist_in_template(template_name, path)
399
- ```
400
-
401
- * Show nodes under in device template
402
- ```python
403
- session.show_measurements_in_template(template_name)
404
- ```
405
-
406
- * Show the path prefix where a device template is set
407
- ```python
408
- session.show_paths_template_set_on(template_name)
409
- ```
410
-
411
- * Show the path prefix where a device template is used (i.e. the time series has been created)
412
- ```python
413
- session.show_paths_template_using_on(template_name)
414
- ```
415
-
416
- #### Drop Device Template
417
- Delete an existing metadata template,dropping an already set template is not supported
418
- ```python
419
- session.drop_schema_template("template_python")
420
- ```
421
334
 
422
335
 
423
336
  ### Pandas Support
@@ -622,9 +535,9 @@ This is an example of how to connect to IoTDB with python, using the thrift rpc
622
535
 
623
536
  ### Prerequisites
624
537
 
625
- Python3.7 or later is preferred.
538
+ Python3.6 or later is preferred.
626
539
 
627
- You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable.
540
+ You have to install Thrift (0.14.1 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable.
628
541
 
629
542
  ```
630
543
  http://thrift.apache.org/docs/install/
@@ -710,8 +623,7 @@ Namely, these are
710
623
 
711
624
  * Remove all transient directories from last release (if exists)
712
625
  * (Re-)generate all generated sources via mvn
713
- * Run Linting (flake8)
714
- * Run Tests via pytest
626
+ * Run Tests via pytest (optional)
715
627
  * Build
716
628
  * Release to pypi
717
629
 
@@ -1,5 +1,5 @@
1
1
  iotdb/IoTDBContainer.py,sha256=gmGMEzacytqvrpCXGn0xrm3ab4LDyToNCHPEFg82Mwg,2514
2
- iotdb/Session.py,sha256=CvIgzCtOE4TvrlraseS4xuDFrWScmauRnv_4Z0o3WMQ,89871
2
+ iotdb/Session.py,sha256=dByc74pmLqWuctP5ILBZpWh_TiiMYcamUWLwH1lor9k,93922
3
3
  iotdb/SessionPool.py,sha256=To4o6oOacL8KEHJbU3G-1BtJywu__dUaAyFUh-t6ON8,5478
4
4
  iotdb/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
5
5
  iotdb/dbapi/Connection.py,sha256=t5CuwOTrMJxJ2YVxaEKi2fdaH9Vob-u7nQRCD_9vLcg,2569
@@ -16,16 +16,15 @@ iotdb/sqlalchemy/IoTDBTypeCompiler.py,sha256=1ZrQvMt3lieN-HUjJLlmSVGy1DwBCWZMwC8
16
16
  iotdb/sqlalchemy/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
17
17
  iotdb/sqlalchemy/tests/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
18
18
  iotdb/sqlalchemy/tests/test_dialect.py,sha256=MdrJXqVpwRznppYvqC3OfVUOjR0sbMU5ubpJacDxOAU,3083
19
- iotdb/template/InternalNode.py,sha256=jLFe_t4BG6Fq-ePD6u6_l8lox6syXDrXgH2S-xzDqiA,1417
20
- iotdb/template/MeasurementNode.py,sha256=bIBAXBFJqbmg4TOFMB8JbzuHTiBjRUew515kde2pWyM,2012
21
- iotdb/template/Template.py,sha256=p5ofgl0urb1eg6qfORR82ry5NbX_oeB8G9oLyvb1atk,3378
22
- iotdb/template/TemplateNode.py,sha256=CxsaJlt65FDayRETADzdDZhMYDybOO6iURDheDFCFAw,1285
19
+ iotdb/template/MeasurementNode.py,sha256=O0-MVLN9a-Sap8uPriQxlmkh_NyUsiWGEoNQgmyBQ28,2315
20
+ iotdb/template/Template.py,sha256=9zSaBsTwT_hWj-qf8Y_r9cIdd4WhdIrhxAl31Ejmo5E,3649
21
+ iotdb/template/TemplateNode.py,sha256=6dR84yg7QV5A4nmGqws8cfV3GygfrR5HErQS5t2ORNw,1556
23
22
  iotdb/template/TemplateQueryType.py,sha256=6bNiydOiIqFnzutiuxdpWrOm-z9CkSawMCd_52EYh44,1272
24
23
  iotdb/template/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
25
24
  iotdb/thrift/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
25
  iotdb/thrift/common/__init__.py,sha256=YFcZTT8Cm-6Y4oTiCaqq0DT1lw2W09WqoEc5_pTAwW0,34
27
26
  iotdb/thrift/common/constants.py,sha256=IKRM8SpfhYWXERWBgUbUhbdFpn363hmZjXDhEYnVRbw,366
28
- iotdb/thrift/common/ttypes.py,sha256=EfE9QC6UmDoOZ42-mP6uLS-cISdt737cLE2cj0yOugM,75737
27
+ iotdb/thrift/common/ttypes.py,sha256=5nQMSxiQ_-nYXFVdNz9Ojy42Qe8JxU_Gm4N90rJCuLg,114618
29
28
  iotdb/thrift/rpc/IClientRPCService.py,sha256=C9CZxONUf14jJgAjrgOXfxwK3rfwfVrnCDnucwpDkwI,416186
30
29
  iotdb/thrift/rpc/__init__.py,sha256=69gRO2XxQu71SDeCRxiZFjK6Xw_61hdl5MdWceI-e1A,55
31
30
  iotdb/thrift/rpc/constants.py,sha256=IKRM8SpfhYWXERWBgUbUhbdFpn363hmZjXDhEYnVRbw,366
@@ -34,33 +33,36 @@ iotdb/tsfile/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
34
33
  iotdb/tsfile/common/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
35
34
  iotdb/tsfile/common/constant/TsFileConstant.py,sha256=uLSw9vnQZ6objfyhO3b9bHTip8yUW5aapPHEsXC0e7s,1165
36
35
  iotdb/tsfile/common/constant/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
36
+ iotdb/tsfile/utils/DateUtils.py,sha256=Z31FexAA_pR72X2PDLT6pVJOFRWguIAEUjOyAwjipcI,1496
37
37
  iotdb/tsfile/utils/Pair.py,sha256=91ecijUAlEiMRLlH2hjRi_mT_xWp6Vm-R3n4Z4USFqQ,952
38
38
  iotdb/tsfile/utils/ReadWriteIOUtils.py,sha256=31CKH_1XWz8xc7DyInKaD-avkY-hVqNQILDb5PMucm4,2977
39
39
  iotdb/tsfile/utils/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
40
40
  iotdb/utils/BitMap.py,sha256=dGvruuvDJlT4KH7pIrkprZWsY_AG-P8HXe6JHBKDOpI,1436
41
- iotdb/utils/Field.py,sha256=VcbEsTVCCzthTcXuZK5lSLH6FKe8SgOKidSDotbhY8s,5910
41
+ iotdb/utils/Field.py,sha256=zc4oJBcib8BPnVpLTq_3sbPfmGRAO7SmQiWeuPgaiGc,7303
42
42
  iotdb/utils/IoTDBConnectionException.py,sha256=D38r5MicwIdVsliCwtipICjx19wbvRI4ye0doAX7DPM,1179
43
- iotdb/utils/IoTDBConstants.py,sha256=u3ZevIqqKlL4NVU5LDGoB0YiZfhsYqkdYWKXfAXU7Tw,1717
44
- iotdb/utils/IoTDBRpcDataSet.py,sha256=vKPuaXq-GL-jpeLQdaK2y__BQoeSvEu8sVv77op9Iuk,16482
45
- iotdb/utils/NumpyTablet.py,sha256=HBlYmjE4Ohy5fimWvP9iex7Xte7LybDPjOHmYnwwVrc,6210
46
- iotdb/utils/RowRecord.py,sha256=-dQRu5YsPoFyDbEpdJdt5Eo-CvGleba9CcCPc7Nm3Vw,1750
47
- iotdb/utils/SessionDataSet.py,sha256=MabD9x9eLi23ytRqLmdpjOW7efrei76HDJBUuzK2Sks,5157
48
- iotdb/utils/Tablet.py,sha256=4ADT4ZJYH9ijQM0OO7dcTMFWDh3oXIHG-Gl8OyQhkLQ,8169
43
+ iotdb/utils/IoTDBConstants.py,sha256=mOXYQvaOccFS0cOUEqSXgZ3qSjhe6K8_sIjTT9S6qaI,1950
44
+ iotdb/utils/IoTDBRpcDataSet.py,sha256=WItp7DSnDucBpkZ2b-qnlLV1eJqA985Gu5FBoxX1Yf4,18231
45
+ iotdb/utils/NumpyTablet.py,sha256=VQiuRb2vJSVgqpzod4OocehXh7JdUNBGH-MTV4lzg0g,6919
46
+ iotdb/utils/RowRecord.py,sha256=TIfQzMdi84GhGGIfVcZ-kvmm7aQwsDWge2kY00sf1lo,1690
47
+ iotdb/utils/SessionDataSet.py,sha256=uS06ceDkhb8TocGM8MzdefofauoOrC4GWYi1TjWQS1w,5359
48
+ iotdb/utils/Tablet.py,sha256=VM0Prem8xqLqV3YF9lbtGQ4N4pqQ1KvdbqrvczB6A2g,9035
49
49
  iotdb/utils/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
50
50
  tests/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
51
- tests/tablet_performance_comparison.py,sha256=cjWV-RGhp73JjzITyKwC7Abx5IRGg00cLrS3cH3BkOo,10724
52
- tests/test_aligned_timeseries.py,sha256=hig7q7UEBEdYiQnCmW2uOUiVopBW9_WpUBWE8sWP8lk,9906
53
- tests/test_dataframe.py,sha256=c3ATEbljj6NKFhbOOAFZX-WC4saoNUFNVfLfic9ogf8,2808
54
- tests/test_delete_data.py,sha256=vDDNWJ_WUZihLOMdwRMyS4r9F6nm-SalVSx1hPXrDlE,5121
55
- tests/test_numpy_tablet.py,sha256=w3lLK8Cft7lGsCj_6Z1Y7kDshltN0osSDJb-EESi6_Y,7235
56
- tests/test_one_device.py,sha256=QW6t8GfH4FnYxZODYztpHEt8m3NAC-AUcs18KKK4q0w,4734
57
- tests/test_session.py,sha256=aLhjUxZJ1IX2DBPuh3h7E4vfJs2jTnBa4dSIDgnMLIo,14343
58
- tests/test_session_pool.py,sha256=v4cbLLwob8JTG0vEV1zhr_YCHM7649JacBOg2Svcemo,3891
59
- tests/test_tablet.py,sha256=m0jLWJPQpy0K8sgOMS-91MaIL8QnwI3u4SWHjcEWbDI,4438
60
- tests/test_template.py,sha256=oN4vL6qvF89NG3vw_kj77RgH2DZVVizQX52AMBWOmCE,4021
61
- tests/test_todf.py,sha256=DPqapHpwjgits_y3OI3fU1mw7JHa8sUMg_-ViJ6NeYg,8071
62
- apache_iotdb-1.3.2.dist-info/METADATA,sha256=cqbP9uBdjETc3PFqZj88YKXf75kMsRqdxl3oPE-2lwI,21482
63
- apache_iotdb-1.3.2.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
64
- apache_iotdb-1.3.2.dist-info/entry_points.txt,sha256=BmQWy6NHyWXorQcVm8-VWpt9MSqe46UFyV2hnsl4yok,73
65
- apache_iotdb-1.3.2.dist-info/top_level.txt,sha256=B9jGGOaAAqF1WrWw2jX2K-naWAZn2nhyrL-6hM1qwyM,12
66
- apache_iotdb-1.3.2.dist-info/RECORD,,
51
+ tests/integration/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
52
+ tests/integration/tablet_performance_comparison.py,sha256=cjWV-RGhp73JjzITyKwC7Abx5IRGg00cLrS3cH3BkOo,10724
53
+ tests/integration/test_aligned_timeseries.py,sha256=hig7q7UEBEdYiQnCmW2uOUiVopBW9_WpUBWE8sWP8lk,9906
54
+ tests/integration/test_dataframe.py,sha256=c3ATEbljj6NKFhbOOAFZX-WC4saoNUFNVfLfic9ogf8,2808
55
+ tests/integration/test_delete_data.py,sha256=vDDNWJ_WUZihLOMdwRMyS4r9F6nm-SalVSx1hPXrDlE,5121
56
+ tests/integration/test_new_data_types.py,sha256=qi1VKybP9S-KNRpXlnzgKYGoMEdRUayrr_WiXy7IN4A,6367
57
+ tests/integration/test_one_device.py,sha256=QW6t8GfH4FnYxZODYztpHEt8m3NAC-AUcs18KKK4q0w,4734
58
+ tests/integration/test_session.py,sha256=aLhjUxZJ1IX2DBPuh3h7E4vfJs2jTnBa4dSIDgnMLIo,14343
59
+ tests/integration/test_session_pool.py,sha256=v4cbLLwob8JTG0vEV1zhr_YCHM7649JacBOg2Svcemo,3891
60
+ tests/integration/test_tablet.py,sha256=m0jLWJPQpy0K8sgOMS-91MaIL8QnwI3u4SWHjcEWbDI,4438
61
+ tests/integration/test_todf.py,sha256=MlntH0pnz9xXx7CJMNlb5Dm3MijKh6tpcQrr7jYTM9Q,8128
62
+ tests/unit/__init__.py,sha256=vGVFsdMOp1iKaCQl5rfYcPVa0FV94d-a7MsMDQDhHMc,789
63
+ tests/unit/test_numpy_tablet.py,sha256=w3lLK8Cft7lGsCj_6Z1Y7kDshltN0osSDJb-EESi6_Y,7235
64
+ apache_iotdb-1.3.3.dist-info/METADATA,sha256=jGvXUIJuiWmpou85Vif79DaggfC6AXjsYsRjAlW9Tt8,18771
65
+ apache_iotdb-1.3.3.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
66
+ apache_iotdb-1.3.3.dist-info/entry_points.txt,sha256=BmQWy6NHyWXorQcVm8-VWpt9MSqe46UFyV2hnsl4yok,73
67
+ apache_iotdb-1.3.3.dist-info/top_level.txt,sha256=B9jGGOaAAqF1WrWw2jX2K-naWAZn2nhyrL-6hM1qwyM,12
68
+ apache_iotdb-1.3.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.1)
2
+ Generator: setuptools (75.5.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
iotdb/Session.py CHANGED
@@ -20,6 +20,7 @@ import logging
20
20
  import random
21
21
  import struct
22
22
  import time
23
+ import warnings
23
24
  from thrift.protocol import TBinaryProtocol, TCompactProtocol
24
25
  from thrift.transport import TSocket, TTransport
25
26
 
@@ -57,9 +58,11 @@ from .thrift.rpc.ttypes import (
57
58
  TSLastDataQueryReq,
58
59
  TSInsertStringRecordsOfOneDeviceReq,
59
60
  )
61
+ from .tsfile.utils.DateUtils import parse_date_to_int
60
62
  from .utils.IoTDBConnectionException import IoTDBConnectionException
61
63
 
62
64
  logger = logging.getLogger("IoTDB")
65
+ warnings.simplefilter("always", DeprecationWarning)
63
66
 
64
67
 
65
68
  class Session(object):
@@ -1440,6 +1443,36 @@ class Session(object):
1440
1443
  values_tobe_packed.append(b"\x05")
1441
1444
  values_tobe_packed.append(len(value_bytes))
1442
1445
  values_tobe_packed.append(value_bytes)
1446
+ # TIMESTAMP
1447
+ elif data_type == 8:
1448
+ format_str_list.append("cq")
1449
+ values_tobe_packed.append(b"\x08")
1450
+ values_tobe_packed.append(value)
1451
+ # DATE
1452
+ elif data_type == 9:
1453
+ format_str_list.append("ci")
1454
+ values_tobe_packed.append(b"\x09")
1455
+ values_tobe_packed.append(parse_date_to_int(value))
1456
+ # BLOB
1457
+ elif data_type == 10:
1458
+ format_str_list.append("ci")
1459
+ format_str_list.append(str(len(value)))
1460
+ format_str_list.append("s")
1461
+ values_tobe_packed.append(b"\x0a")
1462
+ values_tobe_packed.append(len(value))
1463
+ values_tobe_packed.append(value)
1464
+ # STRING
1465
+ elif data_type == 11:
1466
+ if isinstance(value, str):
1467
+ value_bytes = bytes(value, "utf-8")
1468
+ else:
1469
+ value_bytes = value
1470
+ format_str_list.append("ci")
1471
+ format_str_list.append(str(len(value_bytes)))
1472
+ format_str_list.append("s")
1473
+ values_tobe_packed.append(b"\x0b")
1474
+ values_tobe_packed.append(len(value_bytes))
1475
+ values_tobe_packed.append(value_bytes)
1443
1476
  else:
1444
1477
  raise RuntimeError("Unsupported data type:" + str(data_type))
1445
1478
  format_str = "".join(format_str_list)
@@ -1810,6 +1843,11 @@ class Session(object):
1810
1843
  return request
1811
1844
 
1812
1845
  def create_schema_template(self, template: Template):
1846
+ warnings.warn(
1847
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
1848
+ DeprecationWarning,
1849
+ stacklevel=2,
1850
+ )
1813
1851
  """
1814
1852
  create device template, users using this method should use the template class as an argument
1815
1853
  :param template: The template contains multiple child node(see Template.py)
@@ -1833,6 +1871,11 @@ class Session(object):
1833
1871
  raise IoTDBConnectionException(self.connection_error_msg()) from None
1834
1872
 
1835
1873
  def drop_schema_template(self, template_name: str):
1874
+ warnings.warn(
1875
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
1876
+ DeprecationWarning,
1877
+ stacklevel=2,
1878
+ )
1836
1879
  """
1837
1880
  drop device template, this method should be used to the template unset anything
1838
1881
  :param template_name: template name
@@ -1861,6 +1904,11 @@ class Session(object):
1861
1904
  compressors: list,
1862
1905
  is_aligned: bool = False,
1863
1906
  ):
1907
+ warnings.warn(
1908
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
1909
+ DeprecationWarning,
1910
+ stacklevel=2,
1911
+ )
1864
1912
  """
1865
1913
  add measurements in the template, the template must already create. This function adds some measurements' node.
1866
1914
  :param template_name: template name, string list, like ["name_x", "name_y", "name_z"]
@@ -1895,6 +1943,11 @@ class Session(object):
1895
1943
  raise IoTDBConnectionException(self.connection_error_msg()) from None
1896
1944
 
1897
1945
  def delete_node_in_template(self, template_name: str, path: str):
1946
+ warnings.warn(
1947
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
1948
+ DeprecationWarning,
1949
+ stacklevel=2,
1950
+ )
1898
1951
  """
1899
1952
  delete a node in the template, this node must be already in the template
1900
1953
  :param template_name: template name
@@ -1916,6 +1969,11 @@ class Session(object):
1916
1969
  raise IoTDBConnectionException(self.connection_error_msg()) from None
1917
1970
 
1918
1971
  def set_schema_template(self, template_name, prefix_path):
1972
+ warnings.warn(
1973
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
1974
+ DeprecationWarning,
1975
+ stacklevel=2,
1976
+ )
1919
1977
  """
1920
1978
  set template in prefix path, template already exit, prefix path is not measurements
1921
1979
  :param template_name: template name
@@ -1937,6 +1995,11 @@ class Session(object):
1937
1995
  raise IoTDBConnectionException(self.connection_error_msg()) from None
1938
1996
 
1939
1997
  def unset_schema_template(self, template_name, prefix_path):
1998
+ warnings.warn(
1999
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
2000
+ DeprecationWarning,
2001
+ stacklevel=2,
2002
+ )
1940
2003
  """
1941
2004
  unset device template from prefix path, this method unsetting the template from entities,
1942
2005
  which have already inserted records using the template, is not supported.
@@ -1961,6 +2024,11 @@ class Session(object):
1961
2024
  raise IoTDBConnectionException(self.connection_error_msg()) from None
1962
2025
 
1963
2026
  def count_measurements_in_template(self, template_name: str):
2027
+ warnings.warn(
2028
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
2029
+ DeprecationWarning,
2030
+ stacklevel=2,
2031
+ )
1964
2032
  """
1965
2033
  drop device template, this method should be used to the template unset anything
1966
2034
  :param template_name: template name
@@ -1986,6 +2054,11 @@ class Session(object):
1986
2054
  raise IoTDBConnectionException(self.connection_error_msg()) from None
1987
2055
 
1988
2056
  def is_measurement_in_template(self, template_name: str, path: str):
2057
+ warnings.warn(
2058
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
2059
+ DeprecationWarning,
2060
+ stacklevel=2,
2061
+ )
1989
2062
  """
1990
2063
  judge the node in the template is measurement or not, this node must in the template
1991
2064
  :param template_name: template name
@@ -2014,6 +2087,11 @@ class Session(object):
2014
2087
  raise IoTDBConnectionException(self.connection_error_msg()) from None
2015
2088
 
2016
2089
  def is_path_exist_in_template(self, template_name: str, path: str):
2090
+ warnings.warn(
2091
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
2092
+ DeprecationWarning,
2093
+ stacklevel=2,
2094
+ )
2017
2095
  """
2018
2096
  judge whether the node is a measurement or not in the template, this node must be in the template
2019
2097
  :param template_name: template name
@@ -2039,6 +2117,11 @@ class Session(object):
2039
2117
  raise IoTDBConnectionException(self.connection_error_msg()) from None
2040
2118
 
2041
2119
  def show_measurements_in_template(self, template_name: str, pattern: str = ""):
2120
+ warnings.warn(
2121
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
2122
+ DeprecationWarning,
2123
+ stacklevel=2,
2124
+ )
2042
2125
  """
2043
2126
  show all measurements under the pattern in template
2044
2127
  :param template_name: template name
@@ -2067,6 +2150,11 @@ class Session(object):
2067
2150
  raise IoTDBConnectionException(self.connection_error_msg()) from None
2068
2151
 
2069
2152
  def show_all_templates(self):
2153
+ warnings.warn(
2154
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
2155
+ DeprecationWarning,
2156
+ stacklevel=2,
2157
+ )
2070
2158
  """
2071
2159
  show all device templates
2072
2160
  """
@@ -2092,6 +2180,11 @@ class Session(object):
2092
2180
  raise IoTDBConnectionException(self.connection_error_msg()) from None
2093
2181
 
2094
2182
  def show_paths_template_set_on(self, template_name):
2183
+ warnings.warn(
2184
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
2185
+ DeprecationWarning,
2186
+ stacklevel=2,
2187
+ )
2095
2188
  """
2096
2189
  show the path prefix where a device template is set
2097
2190
  :param template_name:
@@ -2116,6 +2209,11 @@ class Session(object):
2116
2209
  raise IoTDBConnectionException(self.connection_error_msg()) from None
2117
2210
 
2118
2211
  def show_paths_template_using_on(self, template_name):
2212
+ warnings.warn(
2213
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
2214
+ DeprecationWarning,
2215
+ stacklevel=2,
2216
+ )
2119
2217
  """
2120
2218
  show the path prefix where a device template is used
2121
2219
  :param template_name:
@@ -15,13 +15,17 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
  #
18
+ import warnings
18
19
 
19
20
  from iotdb.utils.IoTDBConstants import TSDataType, TSEncoding, Compressor
20
21
  from .TemplateNode import TemplateNode
21
22
  from ..tsfile.utils.ReadWriteIOUtils import ReadWriteUtils
22
23
 
24
+ warnings.simplefilter("always", DeprecationWarning)
25
+
23
26
 
24
27
  class MeasurementNode(TemplateNode):
28
+
25
29
  def __init__(
26
30
  self,
27
31
  name: str,
@@ -29,6 +33,12 @@ class MeasurementNode(TemplateNode):
29
33
  encoding: TSEncoding,
30
34
  compression_type: Compressor,
31
35
  ):
36
+ super().__init__(name)
37
+ warnings.warn(
38
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
39
+ DeprecationWarning,
40
+ stacklevel=2,
41
+ )
32
42
  self.name = name
33
43
  self.data_type = data_type
34
44
  self.encoding = encoding
@@ -17,15 +17,23 @@
17
17
  #
18
18
 
19
19
  import struct
20
+ import warnings
20
21
 
21
22
  from .TemplateNode import TemplateNode
22
23
  from ..tsfile.common.constant.TsFileConstant import TsFileConstant
23
24
  from ..tsfile.utils.Pair import Pair
24
25
  from ..tsfile.utils.ReadWriteIOUtils import ReadWriteUtils
25
26
 
27
+ warnings.simplefilter("always", DeprecationWarning)
28
+
26
29
 
27
30
  class Template:
28
31
  def __init__(self, name, share_time: bool = False):
32
+ warnings.warn(
33
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
34
+ DeprecationWarning,
35
+ stacklevel=2,
36
+ )
29
37
  self.name = name
30
38
  self.children = dict()
31
39
  self.share_time = share_time
@@ -15,6 +15,9 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
  #
18
+ import warnings
19
+
20
+ warnings.simplefilter("always", DeprecationWarning)
18
21
 
19
22
 
20
23
  class TemplateNode(object):
@@ -23,6 +26,11 @@ class TemplateNode(object):
23
26
  """
24
27
 
25
28
  def __init__(self, name):
29
+ warnings.warn(
30
+ "The APIs about template are deprecated and will be removed in future versions. Use sql instead.",
31
+ DeprecationWarning,
32
+ stacklevel=2,
33
+ )
26
34
  self.name = name
27
35
 
28
36
  def get_name(self):