vastdb 0.0.5.4__py3-none-any.whl → 0.0.5.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/api.py CHANGED
@@ -974,8 +974,16 @@ 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
+ src_timestamp=None, retention_in_mins=None, past_threshold_ts=None, future_threshold_ts=None):
979
987
  """
980
988
  Create a table, use the following request
981
989
  POST /bucket/schema/table?table HTTP/1.1
@@ -997,6 +1005,10 @@ class VastdbApi:
997
1005
  headers['Content-Length'] = str(len(serialized_schema))
998
1006
  url_params = {'topic_partitions': str(topic_partitions)} if topic_partitions else {}
999
1007
 
1008
+ if topic_partitions > 0:
1009
+ 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)
1010
+ url_params['table-props'] = table_props
1011
+
1000
1012
  res = self.session.post(self._api_prefix(bucket=bucket, schema=schema, table=name, command="table", url_params=url_params),
1001
1013
  data=serialized_schema, headers=headers)
1002
1014
  return self._check_res(res, "create_table", expected_retvals)
@@ -1048,7 +1060,8 @@ class VastdbApi:
1048
1060
  return self._check_res(res, "get_table_stats", expected_retvals)
1049
1061
 
1050
1062
  def alter_table(self, bucket, schema, name, txid=0, client_tags=[], table_properties="",
1051
- new_name="", expected_retvals=[]):
1063
+ new_name="", expected_retvals=[],
1064
+ src_timestamp=None, retention_in_mins=None, past_threshold_ts=None, future_threshold_ts=None):
1052
1065
  """
1053
1066
  PUT /mybucket/myschema/mytable?table HTTP/1.1
1054
1067
  Content-Length: ContentLength
@@ -1060,6 +1073,9 @@ class VastdbApi:
1060
1073
  """
1061
1074
  builder = flatbuffers.Builder(1024)
1062
1075
 
1076
+ 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:
1077
+ 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)
1078
+
1063
1079
  properties = builder.CreateString(table_properties)
1064
1080
  tabular_alter_table.Start(builder)
1065
1081
  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.6
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=ZHnRQAvWEAEFDVaIWHj6zd0mbEWAhMpQORAaCV6cNKA,126599
152
+ vastdb-0.0.5.6.dist-info/LICENSE,sha256=obffan7LYrq7hLHNrY7vHcn2pKUTBUYXMKu-VOAvDxU,11333
153
+ vastdb-0.0.5.6.dist-info/METADATA,sha256=ZlqMsG2kKEOaQcsRSLoCzR2aQ1dA7pGQVyv66W4L89U,1349
154
+ vastdb-0.0.5.6.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
155
+ vastdb-0.0.5.6.dist-info/top_level.txt,sha256=Vsj2MKtlhPg0J4so64slQtnwjhgoPmJgcG-6YcVAwVc,20
156
+ vastdb-0.0.5.6.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