vastdb 0.0.5.10__py3-none-any.whl → 0.0.5.12__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/api.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import array
2
2
  import logging
3
3
  import struct
4
+ import time
4
5
  import urllib.parse
5
6
  from collections import defaultdict, namedtuple
6
7
  from datetime import datetime
@@ -1016,6 +1017,15 @@ class VastdbApi:
1016
1017
 
1017
1018
  return snapshots, is_truncated, marker
1018
1019
 
1020
+ def _make_sure_schema_exists(self, bucket, schema, timeout_sec=3):
1021
+ start_time = time.time()
1022
+ while time.time() - start_time < timeout_sec:
1023
+ _, schemas, _, _, _ = self.list_schemas(bucket)
1024
+ if schema in (x[0] for x in schemas):
1025
+ return
1026
+ self.create_schema(bucket, schema)
1027
+ raise Exception(f"Failed to find or create schema {schema} in {timeout_sec} seconds.")
1028
+
1019
1029
  def create_table(self, bucket, schema, name, arrow_schema=None, txid=0, client_tags=[], expected_retvals=[],
1020
1030
  create_imports_table=False, use_external_row_ids_allocation=False):
1021
1031
  return self._create_table_internal(bucket=bucket, schema=schema, name=name, arrow_schema=arrow_schema,
@@ -1026,6 +1036,7 @@ class VastdbApi:
1026
1036
  def create_topic(self, bucket, name, topic_partitions, expected_retvals=[],
1027
1037
  message_timestamp_type=None, retention_ms=None,
1028
1038
  message_timestamp_after_max_ms=None, message_timestamp_before_max_ms=None):
1039
+ self._make_sure_schema_exists(bucket, KAFKA_TOPICS_SCHEMA_NAME)
1029
1040
  table_props = _encode_table_props(message_timestamp_type=message_timestamp_type,
1030
1041
  retention_ms=retention_ms,
1031
1042
  message_timestamp_after_max_ms=message_timestamp_after_max_ms,
@@ -1094,6 +1105,8 @@ class VastdbApi:
1094
1105
  # create the table
1095
1106
  return self.create_table(bucket, schema, name, arrow_schema, txid, client_tags, expected_retvals)
1096
1107
 
1108
+ def get_topic_stats(self, bucket, name, expected_retvals=[]):
1109
+ return self.get_table_stats(bucket=bucket, schema=KAFKA_TOPICS_SCHEMA_NAME, name=name, expected_retvals=expected_retvals)
1097
1110
 
1098
1111
  def get_table_stats(self, bucket, schema, name, txid=0, client_tags=[], expected_retvals=[]):
1099
1112
  """
@@ -1127,7 +1140,7 @@ class VastdbApi:
1127
1140
  table_properties = ""
1128
1141
 
1129
1142
  return self.alter_table(bucket=bucket, schema=KAFKA_TOPICS_SCHEMA_NAME, name=name,
1130
- table_properties=table_properties, expected_retvals=expected_retvals)
1143
+ table_properties=table_properties, new_name=new_name, expected_retvals=expected_retvals)
1131
1144
 
1132
1145
  def alter_table(self, bucket, schema, name, txid=0, client_tags=[], table_properties="",
1133
1146
  new_name="", expected_retvals=[]):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vastdb
3
- Version: 0.0.5.10
3
+ Version: 0.0.5.12
4
4
  Summary: VAST Data SDK
5
5
  Home-page: https://github.com/vast-data/vastdb_sdk
6
6
  Author: VAST DATA
@@ -148,9 +148,9 @@ vast_flatbuf/tabular/ObjectDetails.py,sha256=5mMZ0iL_iC1cztyyjPeEeJv3ch6Nk1zyCOc
148
148
  vast_flatbuf/tabular/S3File.py,sha256=KC9c2oS5-JXwTTriUVFdjOvRG0B54Cq9kviSDZY3NI0,4450
149
149
  vast_flatbuf/tabular/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
150
150
  vastdb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
151
- vastdb/api.py,sha256=nqsUzGeEPWSuO402dUQp_-6BPdZI0EXjBxc48GifA1M,131408
152
- vastdb-0.0.5.10.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
153
- vastdb-0.0.5.10.dist-info/METADATA,sha256=i1r5ba8-9wFSZhHtqAp2lcbhZAZd8CvMDucLdSDZr-c,1370
154
- vastdb-0.0.5.10.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
155
- vastdb-0.0.5.10.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
156
- vastdb-0.0.5.10.dist-info/RECORD,,
151
+ vastdb/api.py,sha256=nJSpwwIP4f_6bGZqDcsgMlSPeqrRuL7-Lgr_lwy3dBs,132142
152
+ vastdb-0.0.5.12.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
153
+ vastdb-0.0.5.12.dist-info/METADATA,sha256=V0va4DHkpsLvmR92TfU6SG3uhn4e2B3isz_UzPqw0YU,1370
154
+ vastdb-0.0.5.12.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
155
+ vastdb-0.0.5.12.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
156
+ vastdb-0.0.5.12.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.45.1)
2
+ Generator: bdist_wheel (0.37.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5