vastdb 1.1.2__py3-none-any.whl → 1.2.0__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/schema.py +12 -5
- vastdb/tests/test_tables.py +15 -0
- {vastdb-1.1.2.dist-info → vastdb-1.2.0.dist-info}/METADATA +1 -1
- {vastdb-1.1.2.dist-info → vastdb-1.2.0.dist-info}/RECORD +7 -7
- {vastdb-1.1.2.dist-info → vastdb-1.2.0.dist-info}/LICENSE +0 -0
- {vastdb-1.1.2.dist-info → vastdb-1.2.0.dist-info}/WHEEL +0 -0
- {vastdb-1.1.2.dist-info → vastdb-1.2.0.dist-info}/top_level.txt +0 -0
vastdb/schema.py
CHANGED
|
@@ -103,9 +103,7 @@ class Schema:
|
|
|
103
103
|
log.debug("Found table: %s", t[0])
|
|
104
104
|
return t[0]
|
|
105
105
|
|
|
106
|
-
def
|
|
107
|
-
"""List all tables under this schema."""
|
|
108
|
-
tables = []
|
|
106
|
+
def _iter_tables(self, table_name=None):
|
|
109
107
|
next_key = 0
|
|
110
108
|
name_prefix = table_name if table_name else ""
|
|
111
109
|
exact_match = bool(table_name)
|
|
@@ -116,11 +114,20 @@ class Schema:
|
|
|
116
114
|
exact_match=exact_match, name_prefix=name_prefix, include_list_stats=exact_match)
|
|
117
115
|
if not curr_tables:
|
|
118
116
|
break
|
|
119
|
-
|
|
117
|
+
yield from curr_tables
|
|
120
118
|
if not is_truncated:
|
|
121
119
|
break
|
|
122
120
|
|
|
123
|
-
|
|
121
|
+
def tables(self, table_name=None) -> List["Table"]:
|
|
122
|
+
"""List all tables under this schema."""
|
|
123
|
+
return [
|
|
124
|
+
_parse_table_info(table_info, self)
|
|
125
|
+
for table_info in self._iter_tables(table_name=table_name)
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
def tablenames(self) -> List[str]:
|
|
129
|
+
"""List all table names under this schema."""
|
|
130
|
+
return [table_info.name for table_info in self._iter_tables()]
|
|
124
131
|
|
|
125
132
|
def drop(self) -> None:
|
|
126
133
|
"""Delete this schema."""
|
vastdb/tests/test_tables.py
CHANGED
|
@@ -127,6 +127,21 @@ def test_exists(session, clean_bucket_name):
|
|
|
127
127
|
assert s.tables() == [t]
|
|
128
128
|
|
|
129
129
|
|
|
130
|
+
def test_list_tables(session, clean_bucket_name):
|
|
131
|
+
with session.transaction() as tx:
|
|
132
|
+
s = tx.bucket(clean_bucket_name).create_schema('s1')
|
|
133
|
+
assert s.tables() == []
|
|
134
|
+
assert s.tablenames() == []
|
|
135
|
+
|
|
136
|
+
tables = [
|
|
137
|
+
s.create_table(f't{i}', pa.schema([(f'x{i}', pa.int64())]))
|
|
138
|
+
for i in range(10)
|
|
139
|
+
]
|
|
140
|
+
assert tables == s.tables()
|
|
141
|
+
tablenames = [t.name for t in tables]
|
|
142
|
+
assert s.tablenames() == tablenames
|
|
143
|
+
|
|
144
|
+
|
|
130
145
|
def test_update_table(session, clean_bucket_name):
|
|
131
146
|
columns = pa.schema([
|
|
132
147
|
('a', pa.int64()),
|
|
@@ -155,7 +155,7 @@ vastdb/config.py,sha256=1tMYtzKXerGcIUjH4tIGEvZNWvO4fviCEdcNCnELJZo,2269
|
|
|
155
155
|
vastdb/conftest.py,sha256=X2kVveySPQYZlVBXUMoo7Oea5IsvmJzjdqq3fpH2kVw,3469
|
|
156
156
|
vastdb/errors.py,sha256=2XR1ko7J5nkfiHSAgwuVAADw0SsyqxOwSeFaGgKZEXM,4186
|
|
157
157
|
vastdb/features.py,sha256=DxV746LSkORwVSD6MP2hdXRfnyoLkJwtOwGmp1dnquo,1322
|
|
158
|
-
vastdb/schema.py,sha256=
|
|
158
|
+
vastdb/schema.py,sha256=IaZDJsx0ms_dJVXeyCcSD8Dt3TNJkqR3739XOnDBM_E,6177
|
|
159
159
|
vastdb/session.py,sha256=toMR0BXwTaECdWDKnIZky1F3MA1SmelRBiqCrqQ3GCM,2067
|
|
160
160
|
vastdb/table.py,sha256=C6Zz0zolRRRbf5EQBvDRAofl3kGvfz4PjZwGeQongTI,31106
|
|
161
161
|
vastdb/transaction.py,sha256=NlVkEowJ_pmtffjWBBDaKExYDKPekjSZyj_fK_bZPJE,3026
|
|
@@ -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=H5BK3Zm0Ocug8kZ2cJeGTC7o8YgZgBDSqkOgwW01hAo,33056
|
|
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.
|
|
206
|
-
vastdb-1.
|
|
207
|
-
vastdb-1.
|
|
208
|
-
vastdb-1.
|
|
209
|
-
vastdb-1.
|
|
205
|
+
vastdb-1.2.0.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
|
|
206
|
+
vastdb-1.2.0.dist-info/METADATA,sha256=O4U-OWABQccLaEF7kOdwqoLO55YG3FkZ3SG5IQs6PS4,1340
|
|
207
|
+
vastdb-1.2.0.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
208
|
+
vastdb-1.2.0.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
|
|
209
|
+
vastdb-1.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|