quasardb 3.14.2.dev5__cp39-cp39-macosx_11_0_arm64.whl → 3.14.2.dev7__cp39-cp39-macosx_11_0_arm64.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.

Potentially problematic release.


This version of quasardb might be problematic. Click here for more details.

Files changed (54) hide show
  1. quasardb/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  2. quasardb/Makefile +11 -11
  3. quasardb/__init__.py +8 -5
  4. quasardb/__init__.pyi +72 -0
  5. quasardb/cmake_install.cmake +1 -1
  6. quasardb/date/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  7. quasardb/date/CMakeFiles/Export/a52b05f964b070ee926bcad51d3288af/dateTargets.cmake +1 -1
  8. quasardb/date/Makefile +11 -11
  9. quasardb/date/cmake_install.cmake +1 -1
  10. quasardb/date/dateTargets.cmake +1 -1
  11. quasardb/libqdb_api.dylib +0 -0
  12. quasardb/numpy/__init__.py +126 -43
  13. quasardb/pandas/__init__.py +55 -20
  14. quasardb/pool.py +6 -0
  15. quasardb/pybind11/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  16. quasardb/pybind11/Makefile +11 -11
  17. quasardb/pybind11/cmake_install.cmake +1 -1
  18. quasardb/quasardb/__init__.pyi +97 -0
  19. quasardb/quasardb/_batch_column.pyi +5 -0
  20. quasardb/quasardb/_batch_inserter.pyi +30 -0
  21. quasardb/quasardb/_blob.pyi +16 -0
  22. quasardb/quasardb/_cluster.pyi +100 -0
  23. quasardb/quasardb/_continuous.pyi +16 -0
  24. quasardb/quasardb/_double.pyi +7 -0
  25. quasardb/quasardb/_entry.pyi +60 -0
  26. quasardb/quasardb/_error.pyi +15 -0
  27. quasardb/quasardb/_integer.pyi +7 -0
  28. quasardb/quasardb/_node.pyi +26 -0
  29. quasardb/quasardb/_options.pyi +105 -0
  30. quasardb/quasardb/_perf.pyi +5 -0
  31. quasardb/quasardb/_properties.pyi +5 -0
  32. quasardb/quasardb/_query.pyi +2 -0
  33. quasardb/quasardb/_reader.pyi +9 -0
  34. quasardb/quasardb/_retry.pyi +16 -0
  35. quasardb/quasardb/_string.pyi +12 -0
  36. quasardb/quasardb/_table.pyi +125 -0
  37. quasardb/quasardb/_tag.pyi +5 -0
  38. quasardb/quasardb/_timestamp.pyi +9 -0
  39. quasardb/quasardb/_writer.pyi +111 -0
  40. quasardb/quasardb/metrics/__init__.pyi +20 -0
  41. quasardb/quasardb.cpython-39-darwin.so +0 -0
  42. quasardb/range-v3/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  43. quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake +1 -1
  44. quasardb/range-v3/CMakeFiles/range.v3.headers.dir/build.make +3 -3
  45. quasardb/range-v3/Makefile +11 -11
  46. quasardb/range-v3/cmake_install.cmake +1 -1
  47. quasardb/range-v3/range-v3-config.cmake +1 -1
  48. quasardb/stats.py +223 -110
  49. {quasardb-3.14.2.dev5.dist-info → quasardb-3.14.2.dev7.dist-info}/METADATA +3 -2
  50. quasardb-3.14.2.dev7.dist-info/RECORD +69 -0
  51. {quasardb-3.14.2.dev5.dist-info → quasardb-3.14.2.dev7.dist-info}/WHEEL +1 -1
  52. quasardb-3.14.2.dev5.dist-info/RECORD +0 -45
  53. {quasardb-3.14.2.dev5.dist-info → quasardb-3.14.2.dev7.dist-info/licenses}/LICENSE.md +0 -0
  54. {quasardb-3.14.2.dev5.dist-info → quasardb-3.14.2.dev7.dist-info}/top_level.txt +0 -0
@@ -28,6 +28,7 @@
28
28
  #
29
29
 
30
30
  import logging
31
+ import warnings
31
32
  from datetime import datetime
32
33
  from functools import partial
33
34
 
@@ -175,35 +176,56 @@ def write_series(series, table, col_name, infer_types=True, dtype=None):
175
176
  )
176
177
 
177
178
 
178
- def query(cluster: quasardb.Cluster, query, index=None, blobs=False, numpy=True):
179
+ def query(
180
+ cluster: quasardb.Cluster,
181
+ query: str,
182
+ index: str = None,
183
+ blobs: bool = False,
184
+ numpy: bool = True,
185
+ ):
179
186
  """
180
- Execute a query and return the results as DataFrames. Returns a dict of
181
- tablename / DataFrame pairs.
182
-
183
- Parameters:
184
- -----------
187
+ Execute *query* and return the result as a pandas DataFrame.
185
188
 
189
+ Parameters
190
+ ----------
186
191
  cluster : quasardb.Cluster
187
- Active connection to the QuasarDB cluster
192
+ Active connection to the QuasarDB cluster.
188
193
 
189
194
  query : str
190
- The query to execute.
191
-
192
- blobs : bool or list
193
- Determines which QuasarDB blob-columns should be returned as bytearrays; otherwise
194
- they are returned as UTF-8 strings.
195
+ The query to execute.
195
196
 
196
- True means every blob column should be returned as byte-array, or a list will
197
- specify which specific columns. Defaults to false, meaning all blobs are returned
198
- as strings.
197
+ index : str | None, default None
198
+ Column to use as index. When None a synthetic index is created and
199
+ named “$index”.
199
200
 
201
+ blobs, numpy
202
+ DEPRECATED – no longer used. Supplying a non-default value raises a
203
+ DeprecationWarning and the argument is ignored.
200
204
  """
205
+ # ------------------------------------------------------------------ deprecations
206
+ if blobs is not False:
207
+ warnings.warn(
208
+ "`blobs` is deprecated and will be removed in a future version; "
209
+ "the argument is ignored.",
210
+ DeprecationWarning,
211
+ stacklevel=2,
212
+ )
213
+ if numpy is not True:
214
+ warnings.warn(
215
+ "`numpy` is deprecated and will be removed in a future version; "
216
+ "the argument is ignored.",
217
+ DeprecationWarning,
218
+ stacklevel=2,
219
+ )
220
+ # ------------------------------------------------------------------------------
221
+
201
222
  logger.debug("querying and returning as DataFrame: %s", query)
202
- (index, m) = qdbnp.query(cluster, query, index=index, dict=True)
203
- df = pd.DataFrame(m)
223
+ index_vals, m = qdbnp.query(cluster, query, index=index, dict=True)
204
224
 
205
- df.set_index(index, inplace=True)
206
- return df
225
+ index_name = "$index" if index is None else index
226
+ index_obj = pd.Index(index_vals, name=index_name)
227
+
228
+ return pd.DataFrame(m, index=index_obj)
207
229
 
208
230
 
209
231
  def stream_dataframes(
@@ -327,7 +349,17 @@ def read_dataframe(conn: quasardb.Cluster, table, **kwargs):
327
349
  # dataframes.
328
350
  dfs = stream_dataframe(conn, table, **kwargs)
329
351
 
330
- return pd.concat(dfs)
352
+ # if result of stream_dataframe is empty this could result in ValueError on pd.concat()
353
+ # as stream_dataframe is a generator there is no easy way to check for this condition without evaluation
354
+ # the most simple way is to catch the ValueError and return an empty DataFrame
355
+ try:
356
+ return pd.concat(dfs, copy=False)
357
+ except ValueError as e:
358
+ logger.error(
359
+ "Error while concatenating dataframes. This can happen if result set is empty. Returning empty dataframe. Error: %s",
360
+ e,
361
+ )
362
+ return pd.DataFrame()
331
363
 
332
364
 
333
365
  def _extract_columns(df, cinfos):
@@ -419,6 +451,7 @@ def write_dataframes(dfs, cluster, *, create=False, shard_size=None, **kwargs):
419
451
 
420
452
  data_by_table.append((table, data))
421
453
 
454
+ kwargs["deprecation_stacklevel"] = kwargs.get("deprecation_stacklevel", 1) + 1
422
455
  return qdbnp.write_arrays(data_by_table, cluster, table=None, index=None, **kwargs)
423
456
 
424
457
 
@@ -427,6 +460,7 @@ def write_dataframe(df, cluster, table, **kwargs):
427
460
  Store a single dataframe into a table. Takes the same arguments as `write_dataframes`, except only
428
461
  a single df/table combination.
429
462
  """
463
+ kwargs["deprecation_stacklevel"] = kwargs.get("deprecation_stacklevel", 1) + 1
430
464
  write_dataframes([(table, df)], cluster, **kwargs)
431
465
 
432
466
 
@@ -438,6 +472,7 @@ def write_pinned_dataframe(*args, **kwargs):
438
472
  "write_pinned_dataframe is deprecated and will be removed in a future release."
439
473
  )
440
474
  logger.warn("Please use write_dataframe directly instead")
475
+ kwargs["deprecation_stacklevel"] = 2
441
476
  return write_dataframe(*args, **kwargs)
442
477
 
443
478
 
quasardb/pool.py CHANGED
@@ -118,6 +118,9 @@ class Pool(object):
118
118
  logger.debug("closing connection {}".format(conn))
119
119
  conn.close()
120
120
 
121
+ def _do_connect(self):
122
+ raise NotImplementedError
123
+
121
124
  def connect(self) -> quasardb.Cluster:
122
125
  """
123
126
  Acquire a new connection from the pool. Returned connection must either
@@ -131,6 +134,9 @@ class Pool(object):
131
134
  logger.info("Acquiring connection from pool")
132
135
  return self._do_connect()
133
136
 
137
+ def _do_release(self):
138
+ raise NotImplementedError
139
+
134
140
  def release(self, conn: quasardb.Cluster):
135
141
  """
136
142
  Put a connection back into the pool
@@ -1,5 +1,5 @@
1
1
  # CMAKE generated file: DO NOT EDIT!
2
- # Generated by "Unix Makefiles" Generator, CMake Version 3.31
2
+ # Generated by "Unix Makefiles" Generator, CMake Version 4.1
3
3
 
4
4
  # Relative path conversion top directories.
5
5
  set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/teamcity/buildAgent/work/938b0bdf6727d1ad/thirdparty")
@@ -1,5 +1,5 @@
1
1
  # CMAKE generated file: DO NOT EDIT!
2
- # Generated by "Unix Makefiles" Generator, CMake Version 3.31
2
+ # Generated by "Unix Makefiles" Generator, CMake Version 4.1
3
3
 
4
4
  # Default target executed when no arguments are given to make.
5
5
  default_target: all
@@ -48,10 +48,10 @@ cmake_force:
48
48
  SHELL = /bin/sh
49
49
 
50
50
  # The CMake executable.
51
- CMAKE_COMMAND = /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/cmake
51
+ CMAKE_COMMAND = /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/cmake
52
52
 
53
53
  # The command to remove a file.
54
- RM = /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/cmake -E rm -f
54
+ RM = /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/cmake -E rm -f
55
55
 
56
56
  # Escaping for special characters.
57
57
  EQUALS = =
@@ -68,7 +68,7 @@ CMAKE_BINARY_DIR = /Users/teamcity/buildAgent/work/938b0bdf6727d1ad/build/temp.m
68
68
  # Special rule for the target edit_cache
69
69
  edit_cache:
70
70
  @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..."
71
- /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
71
+ /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
72
72
  .PHONY : edit_cache
73
73
 
74
74
  # Special rule for the target edit_cache
@@ -78,7 +78,7 @@ edit_cache/fast: edit_cache
78
78
  # Special rule for the target rebuild_cache
79
79
  rebuild_cache:
80
80
  @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
81
- /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
81
+ /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
82
82
  .PHONY : rebuild_cache
83
83
 
84
84
  # Special rule for the target rebuild_cache
@@ -97,37 +97,37 @@ list_install_components/fast: list_install_components
97
97
  # Special rule for the target install
98
98
  install: preinstall
99
99
  @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
100
- /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/cmake -P cmake_install.cmake
100
+ /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/cmake -P cmake_install.cmake
101
101
  .PHONY : install
102
102
 
103
103
  # Special rule for the target install
104
104
  install/fast: preinstall/fast
105
105
  @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
106
- /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/cmake -P cmake_install.cmake
106
+ /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/cmake -P cmake_install.cmake
107
107
  .PHONY : install/fast
108
108
 
109
109
  # Special rule for the target install/local
110
110
  install/local: preinstall
111
111
  @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
112
- /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
112
+ /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
113
113
  .PHONY : install/local
114
114
 
115
115
  # Special rule for the target install/local
116
116
  install/local/fast: preinstall/fast
117
117
  @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
118
- /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
118
+ /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
119
119
  .PHONY : install/local/fast
120
120
 
121
121
  # Special rule for the target install/strip
122
122
  install/strip: preinstall
123
123
  @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
124
- /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
124
+ /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
125
125
  .PHONY : install/strip
126
126
 
127
127
  # Special rule for the target install/strip
128
128
  install/strip/fast: preinstall/fast
129
129
  @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
130
- /Users/teamcity/buildAgent/temp/buildTmp/build-env-t_gg10xe/lib/python3.9/site-packages/cmake/data/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
130
+ /Users/teamcity/buildAgent/temp/buildTmp/build-env-35o718ah/lib/python3.9/site-packages/cmake/data/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
131
131
  .PHONY : install/strip/fast
132
132
 
133
133
  # The main all target
@@ -34,7 +34,7 @@ endif()
34
34
 
35
35
  # Set path to fallback-tool for dependency-resolution.
36
36
  if(NOT DEFINED CMAKE_OBJDUMP)
37
- set(CMAKE_OBJDUMP "/usr/local/clang16/bin/llvm-objdump")
37
+ set(CMAKE_OBJDUMP "/usr/bin/objdump")
38
38
  endif()
39
39
 
40
40
  string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
@@ -0,0 +1,97 @@
1
+ import datetime
2
+
3
+ from . import metrics
4
+ from ._batch_column import BatchColumnInfo
5
+ from ._batch_inserter import TimeSeriesBatch
6
+ from ._blob import Blob
7
+ from ._cluster import Cluster
8
+ from ._continuous import QueryContinuous
9
+ from ._double import Double
10
+ from ._entry import Entry, ExpirableEntry
11
+ from ._error import (
12
+ AliasAlreadyExistsError,
13
+ AliasNotFoundError,
14
+ AsyncPipelineFullError,
15
+ Error,
16
+ IncompatibleTypeError,
17
+ InputBufferTooSmallError,
18
+ InternalLocalError,
19
+ InvalidArgumentError,
20
+ InvalidDatetimeError,
21
+ InvalidHandleError,
22
+ InvalidQueryError,
23
+ NotImplementedError,
24
+ OutOfBoundsError,
25
+ TryAgainError,
26
+ UninitializedError,
27
+ )
28
+ from ._integer import Integer
29
+ from ._node import DirectBlob, DirectInteger, Node
30
+ from ._options import Options
31
+ from ._perf import Perf
32
+ from ._query import FindQuery
33
+ from ._reader import Reader
34
+ from ._retry import RetryOptions
35
+ from ._string import String
36
+ from ._table import ColumnInfo, ColumnType, IndexedColumnInfo, Table
37
+ from ._tag import Tag
38
+ from ._timestamp import Timestamp
39
+ from ._writer import Writer, WriterData, WriterPushMode
40
+
41
+ __all__ = [
42
+ "BatchColumnInfo",
43
+ "TimeSeriesBatch",
44
+ "Blob",
45
+ "Cluster",
46
+ "QueryContinuous",
47
+ "Double",
48
+ "Entry",
49
+ "ExpirableEntry",
50
+ "Error",
51
+ "AliasAlreadyExistsError",
52
+ "AliasNotFoundError",
53
+ "AsyncPipelineFullError",
54
+ "IncompatibleTypeError",
55
+ "InputBufferTooSmallError",
56
+ "InternalLocalError",
57
+ "InvalidArgumentError",
58
+ "InvalidDatetimeError",
59
+ "InvalidHandleError",
60
+ "InvalidQueryError",
61
+ "NotImplementedError",
62
+ "OutOfBoundsError",
63
+ "TryAgainError",
64
+ "UninitializedError",
65
+ "Integer",
66
+ "DirectBlob",
67
+ "DirectInteger",
68
+ "Node",
69
+ "Options",
70
+ "Perf",
71
+ "FindQuery",
72
+ "Reader",
73
+ "RetryOptions",
74
+ "String",
75
+ "ColumnInfo",
76
+ "ColumnType",
77
+ "IndexedColumnInfo",
78
+ "Table",
79
+ "Tag",
80
+ "Timestamp",
81
+ "Writer",
82
+ "WriterData",
83
+ "WriterPushMode",
84
+ "metrics",
85
+ ]
86
+
87
+ never_expires: datetime.datetime = ...
88
+
89
+ def build() -> str:
90
+ """
91
+ Return build number
92
+ """
93
+
94
+ def version() -> str:
95
+ """
96
+ Return version number
97
+ """
@@ -0,0 +1,5 @@
1
+ class BatchColumnInfo:
2
+ column: str
3
+ elements_count_hint: int
4
+ timeseries: str
5
+ def __init__(self, ts_name: str, col_name: str, size_hint: int = 0) -> None: ...
@@ -0,0 +1,30 @@
1
+ class TimeSeriesBatch:
2
+ def push(self) -> None:
3
+ """
4
+ Regular batch push
5
+ """
6
+
7
+ def push_async(self) -> None:
8
+ """
9
+ Asynchronous batch push that buffers data inside the QuasarDB daemon
10
+ """
11
+
12
+ def push_fast(self) -> None:
13
+ """
14
+ Fast, in-place batch push that is efficient when doing lots of small, incremental pushes.
15
+ """
16
+
17
+ def push_truncate(self, **kwargs) -> None:
18
+ """
19
+ Before inserting data, truncates any existing data. This is useful when you want your insertions to be idempotent, e.g. in case of a retry.
20
+ """
21
+
22
+ def set_blob(self, index: int, blob: bytes) -> None: ...
23
+ def set_double(self, index: int, double: float) -> None: ...
24
+ def set_int64(self, index: int, int64: int) -> None: ...
25
+ def set_string(self, index: int, string: str) -> None: ...
26
+ def set_timestamp(self, index: int, timestamp: object) -> None: ...
27
+ def start_row(self, ts: object) -> None:
28
+ """
29
+ Calling this function marks the beginning of processing a new row.
30
+ """
@@ -0,0 +1,16 @@
1
+ import datetime
2
+
3
+ from ._entry import ExpirableEntry
4
+
5
+ class Blob(ExpirableEntry):
6
+ def compare_and_swap(self, new_content: str, comparand: str) -> bytes: ...
7
+ def get(self) -> bytes: ...
8
+ def get_and_remove(self) -> bytes: ...
9
+ def get_and_update(self, data: str) -> bytes: ...
10
+ def put(self, data: str) -> None: ...
11
+ def remove_if(self, comparand: str) -> None: ...
12
+ def update(
13
+ self,
14
+ data: str,
15
+ expiry: datetime.datetime = datetime.datetime.fromtimestamp(0),
16
+ ) -> None: ...
@@ -0,0 +1,100 @@
1
+ from __future__ import annotations
2
+
3
+ import datetime
4
+
5
+ import numpy as np
6
+
7
+ from ._batch_column import BatchColumnInfo
8
+ from ._batch_inserter import TimeSeriesBatch
9
+ from ._blob import Blob
10
+ from ._continuous import QueryContinuous
11
+ from ._double import Double
12
+ from ._integer import Integer
13
+ from ._node import Node
14
+ from ._options import Options
15
+ from ._perf import Perf
16
+ from ._properties import Properties
17
+ from ._reader import Reader
18
+ from ._string import String
19
+ from ._table import Table
20
+ from ._tag import Tag
21
+ from ._timestamp import Timestamp
22
+ from ._writer import Writer
23
+
24
+ class Cluster:
25
+ """
26
+ Represents a connection to the QuasarDB cluster.
27
+ """
28
+
29
+ def __enter__(self) -> Cluster: ...
30
+ def __exit__(self, exc_type: object, exc_value: object, exc_tb: object) -> None: ...
31
+ def __init__(
32
+ self,
33
+ uri: str,
34
+ user_name: str = "",
35
+ user_private_key: str = "",
36
+ cluster_public_key: str = "",
37
+ user_security_file: str = "",
38
+ cluster_public_key_file: str = "",
39
+ timeout: datetime.timedelta = datetime.timedelta(minutes=1),
40
+ do_version_check: bool = False,
41
+ enable_encryption: bool = False,
42
+ compression_mode: Options.Compression = ..., # balanced
43
+ client_max_parallelism: int = 0,
44
+ ) -> None: ...
45
+ def blob(self, alias: str) -> Blob: ...
46
+ def close(self) -> None: ...
47
+ def compact_abort(self) -> None: ...
48
+ def compact_full(self) -> None: ...
49
+ def compact_progress(self) -> int: ...
50
+ def double(self, alias: str) -> Double: ...
51
+ def endpoints(self) -> list[str]: ...
52
+ def find(self, query: str) -> list[str]: ...
53
+ def get_memory_info(self) -> str: ...
54
+ def inserter(self, column_info_list: list[BatchColumnInfo]) -> TimeSeriesBatch: ...
55
+ def integer(self, alias: str) -> Integer: ...
56
+ def is_open(self) -> bool: ...
57
+ def node(self, uri: str) -> Node: ...
58
+ def node_config(self, uri: str) -> dict[str, object]: ...
59
+ def node_status(self, uri: str) -> dict[str, object]: ...
60
+ def node_topology(self, uri: str) -> dict[str, object]: ...
61
+ def options(self) -> Options: ...
62
+ def perf(self) -> Perf: ...
63
+ def pinned_writer(self) -> Writer: ...
64
+ def prefix_count(self, prefix: str) -> int: ...
65
+ def prefix_get(self, prefix: str, max_count: int) -> list[str]: ...
66
+ def properties(self) -> Properties: ...
67
+ def purge_all(self, timeout: datetime.timedelta) -> None: ...
68
+ def purge_cache(self, timeout: datetime.timedelta) -> None: ...
69
+ def query(
70
+ self, query: str, blobs: bool | list[str] = False
71
+ ) -> list[dict[str, object]]: ...
72
+ def query_continuous_full(
73
+ self, query: str, pace: datetime.timedelta, blobs: bool | list[str] = False
74
+ ) -> QueryContinuous: ...
75
+ def query_continuous_new_values(
76
+ self, query: str, pace: datetime.timedelta, blobs: bool | list[str] = False
77
+ ) -> QueryContinuous: ...
78
+ def query_numpy(self, query: str) -> list[tuple[str, np.ma.MaskedArray]]: ...
79
+ def reader(
80
+ self,
81
+ table_names: list[str],
82
+ column_names: list[str] = [],
83
+ batch_size: int = 0,
84
+ ranges: list[tuple] = [],
85
+ ) -> Reader: ...
86
+ def string(self, alias: str) -> String: ...
87
+ def suffix_count(self, suffix: str) -> int: ...
88
+ def suffix_get(self, suffix: str, max_count: int) -> list[str]: ...
89
+ def table(self, alias: str) -> Table: ...
90
+ def tag(self, alias: str) -> Tag: ...
91
+ def tidy_memory(self) -> None: ...
92
+ def timestamp(self, alias: str) -> Timestamp: ...
93
+ def trim_all(
94
+ self, pause: datetime.timedelta, timeout: datetime.timedelta
95
+ ) -> None: ...
96
+ def ts(self, alias: str) -> Table: ...
97
+ def ts_batch(self, column_info_list: list[BatchColumnInfo]) -> TimeSeriesBatch: ...
98
+ def uri(self) -> str: ...
99
+ def wait_for_compaction(self) -> None: ...
100
+ def writer(self) -> Writer: ...
@@ -0,0 +1,16 @@
1
+ from __future__ import annotations
2
+
3
+ # import datetime
4
+
5
+ class QueryContinuous:
6
+ def __iter__(self) -> QueryContinuous: ...
7
+ def __next__(self) -> list[dict[str, object]]: ...
8
+ def probe_results(self) -> list[dict[str, object]]: ...
9
+ def results(self) -> list[dict[str, object]]: ...
10
+ # def run(
11
+ # self,
12
+ # mode: qdb_query_continuous_mode_type_t,
13
+ # pace: datetime.timedelta,
14
+ # query: str,
15
+ # ) -> None: ...
16
+ def stop(self) -> None: ...
@@ -0,0 +1,7 @@
1
+ from ._entry import ExpirableEntry
2
+
3
+ class Double(ExpirableEntry):
4
+ def add(self, addend: float) -> float: ...
5
+ def get(self) -> float: ...
6
+ def put(self, double: float) -> None: ...
7
+ def update(self, double: float) -> None: ...
@@ -0,0 +1,60 @@
1
+ from __future__ import annotations
2
+
3
+ import datetime
4
+
5
+ class Entry:
6
+ class Metadata: ...
7
+
8
+ class Type:
9
+ Uninitialized: Entry.Type # value = <Type.Uninitialized: -1>
10
+ Blob: Entry.Type # value = <Type.Blob: 0>
11
+ Integer: Entry.Type # value = <Type.Integer: 1>
12
+ HashSet: Entry.Type # value = <Type.HashSet: 2>
13
+ Tag: Entry.Type # value = <Type.Tag: 3>
14
+ Deque: Entry.Type # value = <Type.Deque: 4>
15
+ Stream: Entry.Type # value = <Type.Stream: 5>
16
+ Timeseries: Entry.Type # value = <Type.Timeseries: 6>
17
+ __members__: dict[str, Entry.Type]
18
+ def __and__(self, other: object) -> object: ...
19
+ def __eq__(self, other: object) -> bool: ...
20
+ def __ge__(self, other: object) -> bool: ...
21
+ def __getstate__(self) -> int: ...
22
+ def __gt__(self, other: object) -> bool: ...
23
+ def __hash__(self) -> int: ...
24
+ def __index__(self) -> int: ...
25
+ def __init__(self, value: int) -> None: ...
26
+ def __int__(self) -> int: ...
27
+ def __invert__(self) -> object: ...
28
+ def __le__(self, other: object) -> bool: ...
29
+ def __lt__(self, other: object) -> bool: ...
30
+ def __ne__(self, other: object) -> bool: ...
31
+ def __or__(self, other: object) -> object: ...
32
+ def __rand__(self, other: object) -> object: ...
33
+ def __repr__(self) -> str: ...
34
+ def __ror__(self, other: object) -> object: ...
35
+ def __rxor__(self, other: object) -> object: ...
36
+ def __setstate__(self, state: int) -> None: ...
37
+ def __str__(self) -> str: ...
38
+ def __xor__(self, other: object) -> object: ...
39
+ @property
40
+ def name(self) -> str: ...
41
+ @property
42
+ def value(self) -> int: ...
43
+
44
+ def attach_tag(self, tag: str) -> bool: ...
45
+ def attach_tags(self, tags: list[str]) -> None: ...
46
+ def detach_tag(self, tag: str) -> bool: ...
47
+ def detach_tags(self, tags: list[str]) -> None: ...
48
+ def exists(self) -> bool: ...
49
+ def get_entry_type(self) -> Entry.Type: ...
50
+ def get_location(self) -> tuple[str, int]: ...
51
+ def get_metadata(self) -> Metadata: ...
52
+ def get_name(self) -> str: ...
53
+ def get_tags(self) -> list[str]: ...
54
+ def has_tag(self, tag: str) -> bool: ...
55
+ def remove(self) -> None: ...
56
+
57
+ class ExpirableEntry(Entry):
58
+ def expires_at(self, expiry_time: datetime.datetime) -> None: ...
59
+ def expires_from_now(self, expiry_delta: datetime.timedelta) -> None: ...
60
+ def get_expiry_time(self) -> datetime.datetime: ...
@@ -0,0 +1,15 @@
1
+ class Error(RuntimeError): ...
2
+ class AliasAlreadyExistsError(Error): ...
3
+ class AliasNotFoundError(Error): ...
4
+ class AsyncPipelineFullError(Error): ...
5
+ class IncompatibleTypeError(Error): ...
6
+ class InputBufferTooSmallError(Error): ...
7
+ class InternalLocalError(Error): ...
8
+ class InvalidArgumentError(Error): ...
9
+ class InvalidDatetimeError(Error): ...
10
+ class InvalidHandleError(Error): ...
11
+ class InvalidQueryError(Error): ...
12
+ class NotImplementedError(Error): ...
13
+ class OutOfBoundsError(Error): ...
14
+ class TryAgainError(Error): ...
15
+ class UninitializedError(Error): ...
@@ -0,0 +1,7 @@
1
+ from ._entry import ExpirableEntry
2
+
3
+ class Integer(ExpirableEntry):
4
+ def add(self, addend: int) -> int: ...
5
+ def get(self) -> int: ...
6
+ def put(self, integer: int) -> None: ...
7
+ def update(self, integer: int) -> None: ...
@@ -0,0 +1,26 @@
1
+ class DirectBlob:
2
+ def get(self) -> bytes: ...
3
+ def put(self, data: str) -> None: ...
4
+ def remove(self) -> None: ...
5
+ def update(self, data: str) -> None: ...
6
+
7
+ class DirectInteger:
8
+ def get(self) -> int: ...
9
+ def put(self, integer: int) -> None: ...
10
+ def remove(self) -> None: ...
11
+ def update(self, integer: int) -> None: ...
12
+
13
+ class Node:
14
+ def __init__(
15
+ self,
16
+ uri: str,
17
+ user_name: str = "",
18
+ user_private_key: str = "",
19
+ cluster_public_key: str = "",
20
+ user_security_file: str = "",
21
+ cluster_public_key_file: str = "",
22
+ enable_encryption: bool = False,
23
+ ) -> None: ...
24
+ def blob(self, alias: str) -> DirectBlob: ...
25
+ def integer(self, alias: str) -> DirectInteger: ...
26
+ def prefix_get(self, prefix: str, max_count: int) -> list[str]: ...