vastdb 0.0.5.4__py3-none-any.whl → 0.0.5.5__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
@@ -974,8 +974,17 @@ class VastdbApi:
974
974
 
975
975
  return snapshots, is_truncated, marker
976
976
 
977
+ @staticmethod
978
+ def encode_table_props(**kwargs):
979
+ if all(v is None for v in kwargs.values()):
980
+ return None
981
+ else:
982
+ return "$".join([f"{k}={v}" for k, v in kwargs.items()])
977
983
 
978
- def create_table(self, bucket, schema, name, arrow_schema, txid=0, client_tags=[], expected_retvals=[], topic_partitions=0):
984
+ def create_table(self, bucket, schema, name, arrow_schema, txid=0, client_tags=[], expected_retvals=[],
985
+ topic_partitions=0, create_imports_table=False, use_external_row_ids_allocation=False):
986
+ topic_partitions=0, create_imports_table=False, use_external_row_ids_allocation=False,
987
+ src_timestamp=None, retention_in_mins=None, past_threshold_ts=None, future_threshold_ts=None):
979
988
  """
980
989
  Create a table, use the following request
981
990
  POST /bucket/schema/table?table HTTP/1.1
@@ -997,6 +1006,10 @@ class VastdbApi:
997
1006
  headers['Content-Length'] = str(len(serialized_schema))
998
1007
  url_params = {'topic_partitions': str(topic_partitions)} if topic_partitions else {}
999
1008
 
1009
+ if topic_partitions > 0:
1010
+ table_props = self.encode_table_props(src_timestamp=src_timestamp, retention_in_mins=retention_in_mins, past_threshold_ts=past_threshold_ts, future_threshold_ts=future_threshold_ts)
1011
+ url_params['table-props'] = table_props
1012
+
1000
1013
  res = self.session.post(self._api_prefix(bucket=bucket, schema=schema, table=name, command="table", url_params=url_params),
1001
1014
  data=serialized_schema, headers=headers)
1002
1015
  return self._check_res(res, "create_table", expected_retvals)
@@ -1048,7 +1061,8 @@ class VastdbApi:
1048
1061
  return self._check_res(res, "get_table_stats", expected_retvals)
1049
1062
 
1050
1063
  def alter_table(self, bucket, schema, name, txid=0, client_tags=[], table_properties="",
1051
- new_name="", expected_retvals=[]):
1064
+ new_name="", expected_retvals=[],
1065
+ src_timestamp=None, retention_in_mins=None, past_threshold_ts=None, future_threshold_ts=None):
1052
1066
  """
1053
1067
  PUT /mybucket/myschema/mytable?table HTTP/1.1
1054
1068
  Content-Length: ContentLength
@@ -1060,6 +1074,9 @@ class VastdbApi:
1060
1074
  """
1061
1075
  builder = flatbuffers.Builder(1024)
1062
1076
 
1077
+ if src_timestamp is not None or retention_in_mins is not None or past_threshold_ts is not None or future_threshold_ts is not None:
1078
+ table_properties = self.encode_table_props(src_timestamp=src_timestamp, retention_in_mins=retention_in_mins, past_threshold_ts=past_threshold_ts, future_threshold_ts=future_threshold_ts)
1079
+
1063
1080
  properties = builder.CreateString(table_properties)
1064
1081
  tabular_alter_table.Start(builder)
1065
1082
  if len(table_properties):
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vastdb
3
- Version: 0.0.5.4
3
+ Version: 0.0.5.5
4
4
  Summary: VAST Data SDK
5
5
  Home-page: https://github.com/vast-data/vastdb_sdk
6
6
  Author: VAST DATA
7
7
  Author-email: hello@vastdata.com
8
8
  License: Copyright (C) VAST Data Ltd.
9
- Platform: UNKNOWN
10
9
  Description-Content-Type: text/markdown
11
10
  License-File: LICENSE
12
11
  Requires-Dist: flatbuffers
@@ -43,5 +42,3 @@ vastdb_session = create_vastdb_session(access_key, secret_key)
43
42
  ```
44
43
  #### For the complete Guide for the SDK please go to VastData github: https://github.com/vast-data/vastdb_sdk
45
44
 
46
-
47
-
@@ -148,9 +148,9 @@ vast_flatbuf/tabular/ObjectDetails.py,sha256=qW0WtbkCYYE_L-Kw6VNRDCLYaRm5lKvTbLN
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=lYM-CM42YBZ0IbR4AkqBFBaFETFORFREWgPab18WJr4,125448
152
- vastdb-0.0.5.4.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
153
- vastdb-0.0.5.4.dist-info/METADATA,sha256=lQ6-XEIX6yPL9DygrrildnMkU1v7EcL0DXjfYFWxEfY,1369
154
- vastdb-0.0.5.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
155
- vastdb-0.0.5.4.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
156
- vastdb-0.0.5.4.dist-info/RECORD,,
151
+ vastdb/api.py,sha256=xAucqj_W_gGIsZdvwSg6nsSXqQOUMOuZL2xhMaFkIbI,126708
152
+ vastdb-0.0.5.5.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
153
+ vastdb-0.0.5.5.dist-info/METADATA,sha256=hx58H4GZBF8jphMOOkxMVlBAVwuRdLSeBRSemdZcQEc,1349
154
+ vastdb-0.0.5.5.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
155
+ vastdb-0.0.5.5.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
156
+ vastdb-0.0.5.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5