fr40-numeric-probe.py

import ast,pathlib,subprocess,os
p=pathlib.Path('/tmp/mizoki-readiness-fr40-final/src/cells/cell02/tests/test_dlp_sdk_contract.py');t=ast.parse(p.read_text());s=next(n.value.value for n in ast.walk(t) if isinstance(n,ast.Assign) and any(isinstance(x,ast.Name) and x.id=='script' for x in n.targets))
s=s[:s.index('    config=Cell2.Cell2Config')]+'''    config=Cell2.Cell2Config(gcp_project_id='')
    svc=Cell2.DLPService(config);provider=Provider();svc.dlp_client=provider
    frame=pd.DataFrame([{'phone':2025550123,'credit_card':4111111111111111}])
    result,summary=asyncio.run(svc.inspect_dataframe(frame))
    assert provider.calls==[] and summary=={} and result.equals(frame)
    assert not attempts
    print('numeric fixture unchanged; inspection/deidentify calls=0; summary empty; network attempts=0')
'''
env={k:v for k,v in os.environ.items() if not k.startswith(('GOOGLE_','GCP_','GCLOUD_','FIRESTORE_','BIGQUERY_'))}
r=subprocess.run(['/tmp/mizoki-dep8h-venv/bin/python','-I','-c',s,'/tmp/mizoki-readiness-fr40-final'],env=env,capture_output=True,text=True);pathlib.Path('/tmp/fr40-numeric-probe.log').write_text(r.stdout+r.stderr);print('exit',r.returncode);print('\n'.join(x for x in r.stdout.splitlines() if 'numeric fixture' in x))
← All docsView source on GitHub →