in notebooks/notebook_template_review.py [0:0]
def validate(self, notebook: Notebook) -> bool:
"""
Parse the costs cell
"""
ret = True
cell = notebook.get()
if not cell['source'][0].startswith("### Costs"):
ret = notebook.report_error(ErrorCode.ERROR_COSTS_NOTFOUND, "Costs section not found")
else:
text = ''
for line in cell['source']:
text += line
if 'BQ' in notebook.costs and 'BigQuery' not in text:
ret = notebook.report_error(ErrorCode.ERROR_COSTS_MISSING, 'Costs section missing reference to BiqQuery')
if 'Vertex' in notebook.costs and 'Vertex' not in text:
ret = notebook.report_error(ErrorCode.ERROR_COSTS_MISSING, 'Costs section missing reference to Vertex')
if 'Dataflow' in notebook.costs and 'Dataflow' not in text:
ret = notebook.report_error(ErrorCode.ERROR_COSTS_MISSING, 'Costs section missing reference to Dataflow')
return ret