Skip to content

Commit 3bb17a4

Browse files
shdzhangcursoragent
andcommitted
fix(GOV-34): accept MANAGED state for access system schema
- GOV-34 failed when access schema had state MANAGED (default-enabled workspaces) - Check now passes for schema='access' AND (state='ENABLE_COMPLETED' OR state='MANAGED') Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e7e533f commit 3bb17a4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

notebooks/Includes/workspace_analysis.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,19 +1311,21 @@ def models_in_uc(df):
13111311

13121312
check_id='105' #GOV-34,Governance,Monitor audit logs with system tables
13131313
enabled, sbp_rec = getSecurityBestPracticeRecord(check_id, cloud_type)
1314-
metastores= {} # hold all the metastores that have no 'access' schema with state ENABLE_COMPLETED
1314+
metastores= {} # hold all the metastores that have no 'access' schema enabled (ENABLE_COMPLETED or MANAGED)
13151315
def uc_systemschemas(df):
13161316
if df is not None and not isEmpty(df):
1317-
return (check_id, 0, {'enable_serverless_compute':'access schema with state ENABLE_COMPLETED found'} )
1317+
return (check_id, 0, {'enable_serverless_compute':'access schema enabled (ENABLE_COMPLETED or MANAGED) found'} )
13181318
else:
1319-
return (check_id, 1, {'enable_serverless_compute':'access schema with state ENABLE_COMPLETED not found'})
1319+
return (check_id, 1, {'enable_serverless_compute':'access schema not enabled (state not ENABLE_COMPLETED or MANAGED)'})
13201320

13211321
if enabled:
13221322
tbl_name = 'systemschemas' + '_' + workspace_id
1323+
# API returns "schema" and "state". Access schema can be ENABLE_COMPLETED or MANAGED (default-enabled).
13231324
sql=f'''
13241325
SELECT *
13251326
FROM {tbl_name}
1326-
where schema ="access" and state ="ENABLE_COMPLETED"
1327+
WHERE schema = "access"
1328+
AND (state = "ENABLE_COMPLETED" OR state = "MANAGED")
13271329
'''
13281330
sqlctrl(workspace_id, sql, uc_systemschemas)
13291331

0 commit comments

Comments
 (0)