vastdb 0.0.5.11__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,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vastdb
3
- Version: 0.0.5.11
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=paEff0MHCm0JV6kEQBBTos0OXKESbdDO2fuHvCNhkNg,131623
152
- vastdb-0.0.5.11.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
153
- vastdb-0.0.5.11.dist-info/METADATA,sha256=lXtF5GeiKZcGuuEoEAEasW7bm5S5FWkzTzZ0rZ3HYdo,1370
154
- vastdb-0.0.5.11.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
155
- vastdb-0.0.5.11.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
156
- vastdb-0.0.5.11.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,,