vastdb 1.3.5__py3-none-any.whl → 1.3.6__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 CHANGED
@@ -1171,6 +1171,9 @@ class VastdbApi:
1171
1171
  url=self._url(bucket=bucket, schema=schema, table=name, command="table", url_params=url_params),
1172
1172
  data=serialized_schema, headers=headers)
1173
1173
 
1174
+ def get_topic_stats(self, bucket, name, expected_retvals=[]):
1175
+ return self.get_table_stats(bucket=bucket, schema=KAFKA_TOPICS_SCHEMA_NAME, name=name, expected_retvals=expected_retvals)
1176
+
1174
1177
  def get_table_stats(self, bucket, schema, name, txid=0, client_tags=[], expected_retvals=[], imports_table_stats=False):
1175
1178
  """
1176
1179
  GET /mybucket/myschema/mytable?stats HTTP/1.1
@@ -1205,7 +1208,7 @@ class VastdbApi:
1205
1208
  table_properties = ""
1206
1209
 
1207
1210
  self.alter_table(bucket=bucket, schema=KAFKA_TOPICS_SCHEMA_NAME, name=name,
1208
- table_properties=table_properties, expected_retvals=expected_retvals)
1211
+ table_properties=table_properties, new_name=new_name, expected_retvals=expected_retvals)
1209
1212
 
1210
1213
  def alter_table(self, bucket, schema, name, txid=0, client_tags=[], table_properties="",
1211
1214
  new_name="", expected_retvals=[]):
vastdb/bucket.py CHANGED
@@ -40,7 +40,7 @@ class Bucket:
40
40
  """List bucket's schemas."""
41
41
  return self._root_schema.schemas(batch_size=batch_size)
42
42
 
43
- def snapshot(self, name, fail_if_missing=True) -> Optional["Bucket"]:
43
+ def snapshot(self, name: str, fail_if_missing=True) -> Optional["Bucket"]:
44
44
  """Get snapshot by name (if exists)."""
45
45
  snapshots, _is_truncated, _next_key = \
46
46
  self.tx._rpc.api.list_snapshots(bucket=self.name, name_prefix=name, max_keys=1)
vastdb/schema.py CHANGED
@@ -122,8 +122,11 @@ class Schema:
122
122
  if not is_truncated:
123
123
  break
124
124
 
125
- def tables(self, table_name=None) -> List["Table"]:
126
- """List all tables under this schema."""
125
+ def tables(self, table_name: str = "") -> List["Table"]:
126
+ """List all tables under this schema if `table_name` is empty.
127
+
128
+ Otherwise, list only the specific table (if exists).
129
+ """
127
130
  return [
128
131
  _parse_table_info(table_info, self)
129
132
  for table_info in self._iter_tables(table_name=table_name)
vastdb/table.py CHANGED
@@ -168,8 +168,11 @@ class Table:
168
168
  log.debug("Found projection: %s", projs[0])
169
169
  return projs[0]
170
170
 
171
- def projections(self, projection_name=None) -> Iterable["Projection"]:
172
- """List all semi-sorted projections of this table."""
171
+ def projections(self, projection_name: str = "") -> Iterable["Projection"]:
172
+ """List all semi-sorted projections of this table if `projection_name` is empty.
173
+
174
+ Otherwise, list only the specific projection (if exists).
175
+ """
173
176
  if self._imports_table:
174
177
  raise errors.NotSupportedCommand(self.bucket.name, self.schema.name, self.name)
175
178
  projections = []
@@ -523,7 +526,7 @@ class Table:
523
526
  self.tx._rpc.api.drop_table(self.bucket.name, self.schema.name, self.name, txid=self.tx.txid, remove_imports_table=self._imports_table)
524
527
  log.info("Dropped table: %s", self.name)
525
528
 
526
- def rename(self, new_name) -> None:
529
+ def rename(self, new_name: str) -> None:
527
530
  """Rename this table."""
528
531
  if self._imports_table:
529
532
  raise errors.NotSupportedCommand(self.bucket.name, self.schema.name, self.name)
@@ -582,7 +585,7 @@ class Table:
582
585
  self.tx._rpc.features.check_imports_table()
583
586
  return Table(name=self.name, schema=self.schema, handle=int(self.handle), _imports_table=True)
584
587
 
585
- def __getitem__(self, col_name):
588
+ def __getitem__(self, col_name: str):
586
589
  """Allow constructing ibis-like column expressions from this table.
587
590
 
588
591
  It is useful for constructing expressions for predicate pushdown in `Table.select()` method.
@@ -630,7 +633,7 @@ class Projection:
630
633
  self.arrow_schema = pa.schema([(col[0], col[1]) for col in columns])
631
634
  return self.arrow_schema
632
635
 
633
- def rename(self, new_name) -> None:
636
+ def rename(self, new_name: str) -> None:
634
637
  """Rename this projection."""
635
638
  self.tx._rpc.api.alter_projection(self.bucket.name, self.schema.name,
636
639
  self.table.name, self.name, txid=self.tx.txid, new_name=new_name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vastdb
3
- Version: 1.3.5
3
+ Version: 1.3.6
4
4
  Summary: VAST Data SDK
5
5
  Home-page: https://github.com/vast-data/vastdb_sdk
6
6
  Author: VAST DATA
@@ -151,15 +151,15 @@ vast_flatbuf/tabular/S3File.py,sha256=KC9c2oS5-JXwTTriUVFdjOvRG0B54Cq9kviSDZY3NI
151
151
  vast_flatbuf/tabular/VipRange.py,sha256=_BJd1RRZAcK76T9vlsHzXKYVsPVaz6WTEAqStMQCAUQ,2069
152
152
  vast_flatbuf/tabular/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
153
153
  vastdb/__init__.py,sha256=J1JjKiFkKC95BHowfh9kJfQFTjRce-QMsc6zF_FfxC0,432
154
- vastdb/_internal.py,sha256=N3Z5uQ9aYj-UlzJTtBBXpht2JV685emtiVhawm1zlKQ,99787
155
- vastdb/bucket.py,sha256=5KuKhPjZOevznZqWHDVVocejvAy7dcwobPuV6BJCfPc,2544
154
+ vastdb/_internal.py,sha256=pp5cfZ5z7eJIEN3OPHoemsOxW_mvQOiaYqLjFKwy5BQ,100003
155
+ vastdb/bucket.py,sha256=aomUbrfK5Oa6FdGPVsoBXgRW39IzYnmsorF8642r990,2549
156
156
  vastdb/config.py,sha256=1tMYtzKXerGcIUjH4tIGEvZNWvO4fviCEdcNCnELJZo,2269
157
157
  vastdb/conftest.py,sha256=X2kVveySPQYZlVBXUMoo7Oea5IsvmJzjdqq3fpH2kVw,3469
158
158
  vastdb/errors.py,sha256=2XR1ko7J5nkfiHSAgwuVAADw0SsyqxOwSeFaGgKZEXM,4186
159
159
  vastdb/features.py,sha256=DxV746LSkORwVSD6MP2hdXRfnyoLkJwtOwGmp1dnquo,1322
160
- vastdb/schema.py,sha256=N9GLEoSFPrbpreJbCwcWGCtknoNQkavqra8UQvCzy3E,6306
160
+ vastdb/schema.py,sha256=ZokzIGWaiwWOSMpCtJnhWC09BFGl09LzoCMOb0wGoK0,6407
161
161
  vastdb/session.py,sha256=toMR0BXwTaECdWDKnIZky1F3MA1SmelRBiqCrqQ3GCM,2067
162
- vastdb/table.py,sha256=PHtirFNL8j9PlXAgJp_rcLU37FgnWj0dPaFPFYWm28o,31186
162
+ vastdb/table.py,sha256=QoER7nHrJbvVh9PnRXz7Fae6UOksSRhKYlY4_7joT4I,31312
163
163
  vastdb/transaction.py,sha256=NlVkEowJ_pmtffjWBBDaKExYDKPekjSZyj_fK_bZPJE,3026
164
164
  vastdb/util.py,sha256=8CUnVRsJukC3uNHNoB5D0qPf0FxS8OSdVB84nNoLJKc,6290
165
165
  vastdb/bench/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -204,8 +204,8 @@ vastdb/tests/util.py,sha256=dpRJYbboDnlqL4qIdvScpp8--5fxRUBIcIYitrfcj9o,555
204
204
  vastdb/vast_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
205
205
  vastdb/vast_tests/test_ha.py,sha256=744P4G6VJ09RIkHhMQL4wlipCBJWQVMhyvUrSc4k1HQ,975
206
206
  vastdb/vast_tests/test_scale.py,sha256=5jGwOdZH6Tv5tPdZYPWoqcxOceI2jA5i2D1zNKZHER4,3958
207
- vastdb-1.3.5.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
208
- vastdb-1.3.5.dist-info/METADATA,sha256=Vsfa6X_4snlbZNOVzNZ5x_HKEDzZozAn1Q3i9rCpRv4,1340
209
- vastdb-1.3.5.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
210
- vastdb-1.3.5.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
211
- vastdb-1.3.5.dist-info/RECORD,,
207
+ vastdb-1.3.6.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
208
+ vastdb-1.3.6.dist-info/METADATA,sha256=gK-e6PbBt--2QXu66EjsHbM1XuRIDxijU6KbMbHRJ4U,1340
209
+ vastdb-1.3.6.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
210
+ vastdb-1.3.6.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
211
+ vastdb-1.3.6.dist-info/RECORD,,
File without changes