kaqing 2.0.84__py3-none-any.whl → 2.0.86__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.

Potentially problematic release.


This version of kaqing might be problematic. Click here for more details.

@@ -28,8 +28,11 @@ class Audit(Command):
28
28
 
29
29
  state, args = self.apply_state(args, state)
30
30
 
31
- r = super().intermediate_run(cmd, state, args, Audit.cmd_list(), display_help=False)
32
- if isinstance(r, str) and r == 'command-missing':
31
+ r = None
32
+ if len(args) > 0:
33
+ r = super().intermediate_run(cmd, state, args, Audit.cmd_list(), display_help=False)
34
+
35
+ if not r or isinstance(r, str) and r == 'command-missing':
33
36
  sql = 'select * from audit order by ts desc limit 10'
34
37
  if args:
35
38
  sql = ' '.join(args)
@@ -50,7 +53,7 @@ class Audit(Command):
50
53
  return [AuditRepairTables()]
51
54
 
52
55
  def help(self, _: ReplState):
53
- return f"{Audit.COMMAND} \t run AWS Athena query on audit database"
56
+ return f'[{Audit.COMMAND}] <sql-statements>\t run SQL queries on Authena audit database'
54
57
 
55
58
  class AuditCommandHelper(click.Command):
56
59
  def get_help(self, ctx: click.Context):
adam/commands/help.py CHANGED
@@ -23,11 +23,12 @@ class Help(Command):
23
23
  return super().run(cmd, state)
24
24
 
25
25
  def section(cmds : list[ReplCommands]):
26
- return [f' {c.help(state)}' for c in cmds if c.help(state)]
26
+ sorted_cmds = sorted(cmds, key=lambda cmd: cmd.command())
27
+ return [f' {c.help(state)}' for c in sorted_cmds if c.help(state)]
27
28
 
28
29
  lines = []
29
30
  lines.append('NAVIGATION')
30
- lines.append(' a: | c: | p:\t switch to another operational device: App, Cassandra or Postgres')
31
+ lines.append(' a: | c: | l: | p:\t switch to another operational device: App, Cassandra, Audit or Postgres')
31
32
  lines.extend(section(ReplCommands.navigation()))
32
33
  lines.append('CHECK CASSANDRA')
33
34
  lines.extend(section(ReplCommands.cassandra_check()))
adam/utils_athena.py CHANGED
@@ -48,14 +48,15 @@ def run_audit_query(sql: str):
48
48
 
49
49
  if state == 'SUCCEEDED':
50
50
  results_response = athena_client.get_query_results(QueryExecutionId=query_execution_id)
51
- column_info = results_response['ResultSet']['Rows'][0]['Data']
52
- columns = [col.get('VarCharValue') for col in column_info]
53
- lines = []
54
- for row in results_response['ResultSet']['Rows'][1:]:
55
- row_data = [col.get('VarCharValue') for col in row['Data']]
56
- lines.append('\t'.join(row_data))
57
-
58
- log(lines_to_tabular(lines, header='\t'.join(columns), separator='\t'))
51
+ if results_response['ResultSet']['Rows']:
52
+ column_info = results_response['ResultSet']['Rows'][0]['Data']
53
+ columns = [col.get('VarCharValue') for col in column_info]
54
+ lines = []
55
+ for row in results_response['ResultSet']['Rows'][1:]:
56
+ row_data = [col.get('VarCharValue') for col in row['Data']]
57
+ lines.append('\t'.join(row_data))
58
+
59
+ log(lines_to_tabular(lines, header='\t'.join(columns), separator='\t'))
59
60
  else:
60
61
  log2(f"Query failed or was cancelled. State: {state}")
61
62
  log2(f"Reason: {query_status['QueryExecution']['Status'].get('StateChangeReason')}")
adam/version.py CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- __version__ = "2.0.84" #: the working version
4
+ __version__ = "2.0.86" #: the working version
5
5
  __release__ = "1.0.0" #: the release version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kaqing
3
- Version: 2.0.84
3
+ Version: 2.0.86
4
4
  Summary: UNKNOWN
5
5
  Home-page: UNKNOWN
6
6
  License: UNKNOWN
@@ -14,9 +14,9 @@ adam/repl_commands.py,sha256=1AFE8AJoyQdJd0tlcwtMnwMjV5G7jL9MDkxJZxdo150,4963
14
14
  adam/repl_session.py,sha256=uIogcvWBh7wd8QQ-p_JgLsyJ8YJgINw5vOd6JIsd7Vo,472
15
15
  adam/repl_state.py,sha256=dXyGlWXcSsfCjrYwMhU44PVn_oThSZ8dhJ5HCVE8-qU,8743
16
16
  adam/utils.py,sha256=sbsNZP3qGJtb6fXCa4dDXHry5ay9ev583cCZIQzy07s,7382
17
- adam/utils_athena.py,sha256=TbDv26_f7gCz0EmBJrtwmNPY0IRa7SaQIUrLiGaXh3o,2250
17
+ adam/utils_athena.py,sha256=_E-Ik-rgpIhDhpwlllH3qlyI3P_8Jcw9b9qSj2Ql2UM,2319
18
18
  adam/utils_net.py,sha256=65fhBnWMCkhGtyHqz95qcHaCo35q-WX1RBkkXG8dKpI,416
19
- adam/version.py,sha256=V7DW_alZgubQUK1rhTS1PMRaCoPuOB_iZiB5r5OguYk,139
19
+ adam/version.py,sha256=36vmTSVWv_AX6PKqQeB4jyszcc7H8wMS_veTlbjQeoo,139
20
20
  adam/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  adam/checks/check.py,sha256=Qopr3huYcMu2bzQgb99dEUYjFzkjKHRI76S6KA9b9Rk,702
22
22
  adam/checks/check_context.py,sha256=FEHkQ32jY1EDopQ2uYWqy9v7aEEX1orLpJWhopwAlh4,402
@@ -62,7 +62,7 @@ adam/commands/commands_utils.py,sha256=ShUcxtDSd9B3NM0GDj3NBvKdmjCGY8qXgeUJpzNF6
62
62
  adam/commands/cp.py,sha256=dyQViRDPNqsKRkxPb7WyEVIBNw7YB6IfYa2q3VtfzyA,3107
63
63
  adam/commands/devices.py,sha256=ygpvjYa_NcezM_hctGOAAuBEHiDJtLtJNlOcLGvFJAc,3184
64
64
  adam/commands/exit.py,sha256=5MWUAmzYBlsrp0CoiTDB13SUkX9Ya18UlGeOIPia6TA,798
65
- adam/commands/help.py,sha256=Ey3R1X8w_CMhdADI0t8dSQ28euhDHheJm7NermiGni4,1645
65
+ adam/commands/help.py,sha256=4IzR4p8UiXr00o1TaymHWm8957EWbWRyuvhrJzZzvc0,1734
66
66
  adam/commands/issues.py,sha256=VS-PC7e-2lywsa-lbmoUX8IY77OPGzFudwbw1g8XmQc,2599
67
67
  adam/commands/login.py,sha256=bj95WWIF7mJDJhnyS9T8xvaZUGL37dj7GlH8TgmODbk,1877
68
68
  adam/commands/logs.py,sha256=T-O9DYXmWEm4G1I5SM6MwyeRwq2aT-WMqNW0XA2MWmo,1165
@@ -79,7 +79,7 @@ adam/commands/rollout.py,sha256=52_4ijna3v-8Oug12et43DRHFDNhiN34p6xLTQmhdbQ,2959
79
79
  adam/commands/shell.py,sha256=wY_PIx7Lt6vuxhFArlfxdEnBbrouCJ3yNHhFn17DEqw,848
80
80
  adam/commands/watch.py,sha256=mmBFpB8T1V7zrNs5b2YNyDDztMym_ILPDdkrbdAXTas,2438
81
81
  adam/commands/audit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
82
- adam/commands/audit/audit.py,sha256=-LsGihEhS_CUr_cNvf4hS0z8SKr2cxcyH8loPcwGEvY,1807
82
+ adam/commands/audit/audit.py,sha256=-sCbR-JxvI5qeUbuwF_HWI_j1pCpCntVZUB9sf3Vxs0,1885
83
83
  adam/commands/audit/audit_repair_tables.py,sha256=5Glsy29md3KH_4_smuVBeu6c4zygICPK8Jiv-fNRC38,1186
84
84
  adam/commands/cql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
85
  adam/commands/cql/cql_completions.py,sha256=dXe51NTWEJis76587IWSn9Av-cjC0J6KMaxlBKfF4wM,411
@@ -183,8 +183,8 @@ adam/sso/idp.py,sha256=fvcwUw_URTgsO6ySaqTIw0zQT2qRO1IPSGhf6rPtybo,5804
183
183
  adam/sso/idp_login.py,sha256=QAtCUeDTVWliJy40RK_oac8Vgybr13xH8wzeBoxPaa8,1754
184
184
  adam/sso/idp_session.py,sha256=9BUHNRf70u4rVKrVY1HKPOEmOviXvkjam8WJxmXSKIM,1735
185
185
  adam/sso/sso_config.py,sha256=5N8WZgIJQBtHUy585XLRWKjpU87_v6QluyNK9E27D5s,2459
186
- kaqing-2.0.84.dist-info/METADATA,sha256=lmjAGlH1YfrrmAG9z7fwnrqxCzsW8QjdvZq5qTeuzQM,132
187
- kaqing-2.0.84.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
188
- kaqing-2.0.84.dist-info/entry_points.txt,sha256=SkzhuQJUWsXOzHeZ5TgQ2c3_g53UGK23zzJU_JTZOZI,39
189
- kaqing-2.0.84.dist-info/top_level.txt,sha256=8_2PZkwBb-xDcnc8a2rAbQeJhXKXskc7zTP7pSPa1fw,5
190
- kaqing-2.0.84.dist-info/RECORD,,
186
+ kaqing-2.0.86.dist-info/METADATA,sha256=IzXUkh-9mv_JDa3XEl6ZFgmrln2ea5qqOOrGoZPHa9I,132
187
+ kaqing-2.0.86.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
188
+ kaqing-2.0.86.dist-info/entry_points.txt,sha256=SkzhuQJUWsXOzHeZ5TgQ2c3_g53UGK23zzJU_JTZOZI,39
189
+ kaqing-2.0.86.dist-info/top_level.txt,sha256=8_2PZkwBb-xDcnc8a2rAbQeJhXKXskc7zTP7pSPa1fw,5
190
+ kaqing-2.0.86.dist-info/RECORD,,