vastdb 1.1.0__py3-none-any.whl → 1.1.1__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.
- vastdb/_internal.py +9 -0
- vastdb/bench/test_sample.py +4 -2
- vastdb/conftest.py +1 -1
- vastdb/session.py +0 -6
- vastdb/table.py +1 -1
- vastdb/tests/test_tables.py +13 -0
- vastdb/transaction.py +4 -8
- vastdb/util.py +5 -0
- {vastdb-1.1.0.dist-info → vastdb-1.1.1.dist-info}/METADATA +3 -4
- {vastdb-1.1.0.dist-info → vastdb-1.1.1.dist-info}/RECORD +13 -13
- {vastdb-1.1.0.dist-info → vastdb-1.1.1.dist-info}/WHEEL +1 -1
- {vastdb-1.1.0.dist-info → vastdb-1.1.1.dist-info}/LICENSE +0 -0
- {vastdb-1.1.0.dist-info → vastdb-1.1.1.dist-info}/top_level.txt +0 -0
vastdb/_internal.py
CHANGED
|
@@ -1298,6 +1298,15 @@ class VastdbApi:
|
|
|
1298
1298
|
|
|
1299
1299
|
return columns, next_key, is_truncated, count
|
|
1300
1300
|
|
|
1301
|
+
def head_bucket(self, bucket_name):
|
|
1302
|
+
"""
|
|
1303
|
+
Reimplemented, instead of depending on boto3 for checking the existence of a bucket.
|
|
1304
|
+
https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html
|
|
1305
|
+
"""
|
|
1306
|
+
return self._request(
|
|
1307
|
+
method="HEAD",
|
|
1308
|
+
url=self._url(bucket=bucket_name))
|
|
1309
|
+
|
|
1301
1310
|
def begin_transaction(self, client_tags=[], expected_retvals=[]):
|
|
1302
1311
|
"""
|
|
1303
1312
|
POST /?transaction HTTP/1.1
|
vastdb/bench/test_sample.py
CHANGED
|
@@ -109,7 +109,7 @@ def load_batch(bucket, session_kwargs, offset, limit):
|
|
|
109
109
|
|
|
110
110
|
def test_ingest(test_bucket_name, session_kwargs, tabular_endpoint_urls, num_workers, perf_metrics_db):
|
|
111
111
|
session = vastdb.connect(**session_kwargs)
|
|
112
|
-
metrics_table = metrics.Table(perf_metrics_db, "
|
|
112
|
+
metrics_table = metrics.Table(perf_metrics_db, "test_ingest")
|
|
113
113
|
|
|
114
114
|
with session.transaction() as tx:
|
|
115
115
|
b = tx.bucket(test_bucket_name)
|
|
@@ -201,9 +201,11 @@ def run_query(session_kwargs, i, bucket_name, endpoint_url):
|
|
|
201
201
|
nbytes=data, rows=rows, cols=len(cols),
|
|
202
202
|
pid=pid, tid=tid, sdk_version=sdk_version))
|
|
203
203
|
|
|
204
|
+
return metrics_rows
|
|
205
|
+
|
|
204
206
|
|
|
205
207
|
def test_scan(test_bucket_name, session, num_workers, session_kwargs, tabular_endpoint_urls, perf_metrics_db):
|
|
206
|
-
metrics_table = metrics.Table(perf_metrics_db, "
|
|
208
|
+
metrics_table = metrics.Table(perf_metrics_db, "test_scan")
|
|
207
209
|
|
|
208
210
|
log.info("starting %d workers, endpoints=%s", num_workers, tabular_endpoint_urls)
|
|
209
211
|
with ProcessPoolExecutor(max_workers=num_workers) as executor:
|
vastdb/conftest.py
CHANGED
vastdb/session.py
CHANGED
|
@@ -23,8 +23,6 @@ class Session:
|
|
|
23
23
|
timeout=None,
|
|
24
24
|
backoff_config: Optional["BackoffConfig"] = None):
|
|
25
25
|
"""Connect to a VAST Database endpoint, using specified credentials."""
|
|
26
|
-
import boto3
|
|
27
|
-
|
|
28
26
|
from . import _internal, features
|
|
29
27
|
|
|
30
28
|
if access is None:
|
|
@@ -42,10 +40,6 @@ class Session:
|
|
|
42
40
|
timeout=timeout,
|
|
43
41
|
backoff_config=backoff_config)
|
|
44
42
|
self.features = features.Features(self.api.vast_version)
|
|
45
|
-
self.s3 = boto3.client('s3',
|
|
46
|
-
aws_access_key_id=access,
|
|
47
|
-
aws_secret_access_key=secret,
|
|
48
|
-
endpoint_url=endpoint)
|
|
49
43
|
|
|
50
44
|
def __repr__(self):
|
|
51
45
|
"""Don't show the secret key."""
|
vastdb/table.py
CHANGED
|
@@ -439,7 +439,7 @@ class Table:
|
|
|
439
439
|
self.update(rows=column_record_batch, columns=columns_name_chunk)
|
|
440
440
|
return row_ids
|
|
441
441
|
|
|
442
|
-
def insert(self, rows: pa.RecordBatch):
|
|
442
|
+
def insert(self, rows: Union[pa.RecordBatch, pa.Table]):
|
|
443
443
|
"""Insert a RecordBatch into this table."""
|
|
444
444
|
if self._imports_table:
|
|
445
445
|
raise errors.NotSupportedCommand(self.bucket.name, self.schema.name, self.name)
|
vastdb/tests/test_tables.py
CHANGED
|
@@ -81,6 +81,19 @@ def test_insert_wide_row(session, clean_bucket_name):
|
|
|
81
81
|
assert actual == expected
|
|
82
82
|
|
|
83
83
|
|
|
84
|
+
def test_multi_batch_table(session, clean_bucket_name):
|
|
85
|
+
columns = pa.schema([pa.field('s', pa.utf8())])
|
|
86
|
+
expected = pa.Table.from_batches([
|
|
87
|
+
pa.record_batch(schema=columns, data=[['a']]),
|
|
88
|
+
pa.record_batch(schema=columns, data=[['b']]),
|
|
89
|
+
pa.record_batch(schema=columns, data=[['c']]),
|
|
90
|
+
])
|
|
91
|
+
|
|
92
|
+
with prepare_data(session, clean_bucket_name, 's', 't', expected) as t:
|
|
93
|
+
actual = t.select().read_all()
|
|
94
|
+
assert actual == expected
|
|
95
|
+
|
|
96
|
+
|
|
84
97
|
def test_insert_empty(session, clean_bucket_name):
|
|
85
98
|
columns = pa.schema([('a', pa.int8()), ('b', pa.float32())])
|
|
86
99
|
data = [[None] * 5, [None] * 5]
|
vastdb/transaction.py
CHANGED
|
@@ -10,8 +10,6 @@ import logging
|
|
|
10
10
|
from dataclasses import dataclass
|
|
11
11
|
from typing import TYPE_CHECKING, Iterable, Optional
|
|
12
12
|
|
|
13
|
-
import botocore
|
|
14
|
-
|
|
15
13
|
from . import bucket, errors, schema, session
|
|
16
14
|
|
|
17
15
|
if TYPE_CHECKING:
|
|
@@ -64,12 +62,10 @@ class Transaction:
|
|
|
64
62
|
def bucket(self, name: str) -> "Bucket":
|
|
65
63
|
"""Return a VAST Bucket, if exists."""
|
|
66
64
|
try:
|
|
67
|
-
self._rpc.
|
|
68
|
-
except
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
raise errors.MissingBucket(name) from e
|
|
72
|
-
raise
|
|
65
|
+
self._rpc.api.head_bucket(name)
|
|
66
|
+
except errors.NotFound as e:
|
|
67
|
+
raise errors.MissingBucket(name) from e
|
|
68
|
+
|
|
73
69
|
return bucket.Bucket(name, self)
|
|
74
70
|
|
|
75
71
|
def catalog_snapshots(self) -> Iterable["Bucket"]:
|
vastdb/util.py
CHANGED
|
@@ -114,6 +114,11 @@ def iter_serialized_slices(batch: Union[pa.RecordBatch, pa.Table], max_rows_per_
|
|
|
114
114
|
|
|
115
115
|
def serialize_record_batch(batch: Union[pa.RecordBatch, pa.Table]):
|
|
116
116
|
"""Serialize a RecordBatch using Arrow IPC format."""
|
|
117
|
+
if isinstance(batch, pa.Table):
|
|
118
|
+
if len(batch.to_batches()) > 1:
|
|
119
|
+
# the server expects a single RecordBatch per request
|
|
120
|
+
batch = batch.combine_chunks()
|
|
121
|
+
|
|
117
122
|
sink = pa.BufferOutputStream()
|
|
118
123
|
with pa.ipc.new_stream(sink, batch.schema) as writer:
|
|
119
124
|
writer.write(batch)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vastdb
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: VAST Data SDK
|
|
5
5
|
Home-page: https://github.com/vast-data/vastdb_sdk
|
|
6
6
|
Author: VAST DATA
|
|
@@ -19,13 +19,12 @@ Requires-Python: >=3.9.0
|
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
Requires-Dist: aws-requests-auth
|
|
22
|
-
Requires-Dist: boto3
|
|
23
22
|
Requires-Dist: flatbuffers
|
|
24
|
-
Requires-Dist: ibis-framework
|
|
23
|
+
Requires-Dist: ibis-framework==9.0.0
|
|
25
24
|
Requires-Dist: pyarrow
|
|
26
25
|
Requires-Dist: requests
|
|
27
26
|
Requires-Dist: xmltodict
|
|
28
|
-
Requires-Dist: backoff
|
|
27
|
+
Requires-Dist: backoff==2.2.1
|
|
29
28
|
|
|
30
29
|
|
|
31
30
|
`vastdb` is a Python-based SDK designed for interacting
|
|
@@ -149,20 +149,20 @@ vast_flatbuf/tabular/S3File.py,sha256=KC9c2oS5-JXwTTriUVFdjOvRG0B54Cq9kviSDZY3NI
|
|
|
149
149
|
vast_flatbuf/tabular/VipRange.py,sha256=_BJd1RRZAcK76T9vlsHzXKYVsPVaz6WTEAqStMQCAUQ,2069
|
|
150
150
|
vast_flatbuf/tabular/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
151
151
|
vastdb/__init__.py,sha256=J1JjKiFkKC95BHowfh9kJfQFTjRce-QMsc6zF_FfxC0,432
|
|
152
|
-
vastdb/_internal.py,sha256=
|
|
152
|
+
vastdb/_internal.py,sha256=KRFNlB25Ckj4nowVUneC5tBSYXpnIv-MDdw4Vn6KYnc,91255
|
|
153
153
|
vastdb/bucket.py,sha256=5KuKhPjZOevznZqWHDVVocejvAy7dcwobPuV6BJCfPc,2544
|
|
154
154
|
vastdb/config.py,sha256=1tMYtzKXerGcIUjH4tIGEvZNWvO4fviCEdcNCnELJZo,2269
|
|
155
|
-
vastdb/conftest.py,sha256=
|
|
155
|
+
vastdb/conftest.py,sha256=X2kVveySPQYZlVBXUMoo7Oea5IsvmJzjdqq3fpH2kVw,3469
|
|
156
156
|
vastdb/errors.py,sha256=2XR1ko7J5nkfiHSAgwuVAADw0SsyqxOwSeFaGgKZEXM,4186
|
|
157
157
|
vastdb/features.py,sha256=DxV746LSkORwVSD6MP2hdXRfnyoLkJwtOwGmp1dnquo,1322
|
|
158
158
|
vastdb/schema.py,sha256=X7IRrogXH7Z0kes-DsDh1bRqIhvjH6owlFigGBXy7XQ,5913
|
|
159
|
-
vastdb/session.py,sha256=
|
|
160
|
-
vastdb/table.py,sha256=
|
|
161
|
-
vastdb/transaction.py,sha256=
|
|
162
|
-
vastdb/util.py,sha256=
|
|
159
|
+
vastdb/session.py,sha256=toMR0BXwTaECdWDKnIZky1F3MA1SmelRBiqCrqQ3GCM,2067
|
|
160
|
+
vastdb/table.py,sha256=XLNAwlRjT9sE8nPzYoBC2ehdYpjbit0gLyG0ieNvVfs,31094
|
|
161
|
+
vastdb/transaction.py,sha256=NlVkEowJ_pmtffjWBBDaKExYDKPekjSZyj_fK_bZPJE,3026
|
|
162
|
+
vastdb/util.py,sha256=eunfTuqbCrqQEFZEO9T15N-Bu8Fqpw7Zlqp2TAGfYaY,5870
|
|
163
163
|
vastdb/bench/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
164
164
|
vastdb/bench/test_perf.py,sha256=gZIqfHva6lNFpD-9bHAe7M8COBjUyrPkHu3E7F8J2L0,1072
|
|
165
|
-
vastdb/bench/test_sample.py,sha256=
|
|
165
|
+
vastdb/bench/test_sample.py,sha256=LgF4syzij09sH3Noiv1EyCAJ9pvrUE5bxR4RJTVEYag,7881
|
|
166
166
|
vastdb/bench/perf_bench/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
167
167
|
vastdb/bench/perf_bench/cli.py,sha256=NtaPEBTDI6PWgEtwI1wVbwmUeA5bwGqAj_Z_2lDJ28I,5931
|
|
168
168
|
vastdb/bench/perf_bench/run.py,sha256=2dKooybt7e8VqM7FzY1jrIu6wZYQuoAF9o7AHVh-WVQ,2632
|
|
@@ -196,14 +196,14 @@ vastdb/tests/test_nested.py,sha256=LPU6uV3Ri23dBzAEMFQqRPbqapV5LfmiHSHkhILPIY0,6
|
|
|
196
196
|
vastdb/tests/test_projections.py,sha256=3y1kubwVrzO-xoR0hyps7zrjOJI8niCYspaFTN16Q9w,4540
|
|
197
197
|
vastdb/tests/test_sanity.py,sha256=oiV2gb05aPyG5RMNUQZlyjNlg3T7Fig1_8OJzpAgcsk,3038
|
|
198
198
|
vastdb/tests/test_schemas.py,sha256=l70YQMlx2UL1KRQhApriiG2ZM7GJF-IzWU31H3Yqn1U,3312
|
|
199
|
-
vastdb/tests/test_tables.py,sha256=
|
|
199
|
+
vastdb/tests/test_tables.py,sha256=3YYytrcPZiflFCM6yZPOBI3pz5iXKy0sQbmUDFRVmdA,32000
|
|
200
200
|
vastdb/tests/test_util.py,sha256=Ok_sAEBJsRGF5Voa_v5eu3eAd52GWu8jMjjQbadwW-s,1260
|
|
201
201
|
vastdb/tests/util.py,sha256=dpRJYbboDnlqL4qIdvScpp8--5fxRUBIcIYitrfcj9o,555
|
|
202
202
|
vastdb/vast_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
203
203
|
vastdb/vast_tests/test_ha.py,sha256=744P4G6VJ09RIkHhMQL4wlipCBJWQVMhyvUrSc4k1HQ,975
|
|
204
204
|
vastdb/vast_tests/test_scale.py,sha256=EpjCJmVAQrNBxVnHGJ-KHCoxevhqOcyqYFPMIIY9s60,2714
|
|
205
|
-
vastdb-1.1.
|
|
206
|
-
vastdb-1.1.
|
|
207
|
-
vastdb-1.1.
|
|
208
|
-
vastdb-1.1.
|
|
209
|
-
vastdb-1.1.
|
|
205
|
+
vastdb-1.1.1.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
|
|
206
|
+
vastdb-1.1.1.dist-info/METADATA,sha256=C6KtrB0iOL3E8noTM0UqjYvurcant8lSNjwukCXnXTE,1340
|
|
207
|
+
vastdb-1.1.1.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
208
|
+
vastdb-1.1.1.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
|
|
209
|
+
vastdb-1.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|