kaq-quant-common 0.1.97__py3-none-any.whl → 0.1.98__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.
@@ -35,6 +35,19 @@ class KaqQuantDdbStreamWriteRepository:
35
35
  self.logger.error(f'KaqQuantDdbStreamWriteRepository.__init__ is occured error: {str(e)} - {str(traceback.format_exc())}')
36
36
  finally:
37
37
  mutex.release()
38
+
39
+ def save_row(self, ddb_table_name: str, row:list=[]):
40
+ '''
41
+ 调用此方法之前, 需要将dataframe中的字符串类型的值 ,添加引号
42
+ '''
43
+ if row is None or len(row) <= 0:
44
+ return
45
+ formatted_values = [f'\'{v}\'' if isinstance(v, str) else str(v) for v in row]
46
+ script = f"insert into {ddb_table_name} values({', '.join(str(x) for x in formatted_values)})"
47
+ try:
48
+ self.session.run(script, clearMemory=True)
49
+ except Exception as e:
50
+ self.logger.error(f'KaqQuantDdbStreamWriteRepository.save2stream is occured error: tableName is {ddb_table_name} - {str(e)} - {str(traceback.format_exc())}')
38
51
 
39
52
  def save2stream(self, ddb_table_name: str, df : pd.DataFrame):
40
53
  '''
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: kaq_quant_common
3
- Version: 0.1.97
3
+ Version: 0.1.98
4
4
  Summary:
5
5
  Author: kevinfuture
6
6
  Author-email: liuenbofuture@foxmail.com
@@ -41,7 +41,7 @@ kaq_quant_common/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
41
41
  kaq_quant_common/resources/kaq_ddb_pool_stream_read_resources.py,sha256=Y-rtGpBF3bNh2mPZ2Lze6D9JZnpkqh24OEh7okikh1w,2536
42
42
  kaq_quant_common/resources/kaq_ddb_stream_init_resources.py,sha256=0MxxbajocTFzcRD344rfZQPKOwwuqCbyoT6dQpIox-o,3349
43
43
  kaq_quant_common/resources/kaq_ddb_stream_read_resources.py,sha256=WShsXMoL8o-JZvrtAd7H2Cg-vrE47QbsdGgURaQwiZs,3165
44
- kaq_quant_common/resources/kaq_ddb_stream_write_resources.py,sha256=7c8dG8YWtRM05XGQ-TRsr7V9sD753pBeyu0dSnF56kU,10850
44
+ kaq_quant_common/resources/kaq_ddb_stream_write_resources.py,sha256=9D3PULU5G7SQKn7k9_N-sl_l0jPJnduNHHcHiJbhUp4,11549
45
45
  kaq_quant_common/resources/kaq_mysql_init_resources.py,sha256=UcqWey6LgoMqvLq1SxK33nS6-rkViGYhzUPxcrucOks,827
46
46
  kaq_quant_common/resources/kaq_mysql_resources.py,sha256=UYBFn-o_fFaNwG6bT2E7CYdsns82EmR4ve2XgC9wFJw,13452
47
47
  kaq_quant_common/resources/kaq_postgresql_resources.py,sha256=iG1eYkciI0xUIBdEpGqKGOLBFxvVrfbBoTuaOmhQ0v0,1762
@@ -61,6 +61,6 @@ kaq_quant_common/utils/signal_utils.py,sha256=zBSyEltNTKqkQCsrETd47kEBb3Q_OWUBUn
61
61
  kaq_quant_common/utils/sqlite_utils.py,sha256=UDDFKfwL0N-jFifl40HdyOCENh2YQfW5so6hRaSJpv0,5722
62
62
  kaq_quant_common/utils/uuid_utils.py,sha256=pm_pnXpd8n9CI66x3A20cOEUiriJyqHaKGCeLrgkBxU,71
63
63
  kaq_quant_common/utils/yml_utils.py,sha256=gcKjb_-uuUajBGAl5QBPIZTg2wXm7qeeJvtHflj_zOE,4513
64
- kaq_quant_common-0.1.97.dist-info/METADATA,sha256=ZCQ2q1phgVK5IglZ5wU1AqUh3URNK9nwA1OIxrBu6nY,1971
65
- kaq_quant_common-0.1.97.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
66
- kaq_quant_common-0.1.97.dist-info/RECORD,,
64
+ kaq_quant_common-0.1.98.dist-info/METADATA,sha256=rIamHSZ62X5SWQA-ova30LhISBgOFwx2Wc9hWMX7r-I,1971
65
+ kaq_quant_common-0.1.98.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
66
+ kaq_quant_common-0.1.98.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.1
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any