Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic_eicu/tutorials/BigQuery_ML.ipynb notebook needs some changes #515

Open
amygdala opened this issue Aug 3, 2022 · 1 comment
Open

Comments

@amygdala
Copy link

amygdala commented Aug 3, 2022

In this notebook: https://github.com/GoogleCloudPlatform/healthcare/blob/master/datathon/mimic_eicu/tutorials/BigQuery_ML.ipynb

I believe that this snippet:

# Set up the substitution preprocessing injection
if bigquery.magics._run_query.func_name != 'format_and_run_query':
  original_run_query = bigquery.magics._run_query

needs to be modified in 2 ways:

bigquery.magics._run_query --> bigquery.magics.magics._run_query
In py3 (which I'm assuming everyone is using now), func_name --> __name__

@amygdala
Copy link
Author

amygdala commented Aug 3, 2022

Even with the above changes, I'm not sure that the substitutions are working, however-- I see this output from that setup cell:

custom %%bigquery magic substitutions:
  {admissions_table} → physionet-data.mimiciii_clinical.admissions
  {d_icd_diagnoses_table} → physionet-data.mimiciii_clinical.d_icd_diagnoses
  {diagnoses_icd_table} → physionet-data.mimiciii_clinical.diagnoses_icd
  {patients_table} → physionet-data.mimiciii_clinical.patients

but running a cell like this:

%%bigquery
SELECT
  COUNT(*) as total,
  SUM(HOSPITAL_EXPIRE_FLAG) as died
FROM
  `{admissions_table}`

gives this error:

ERROR:
 400 Table "{admissions_table}" must be qualified with a dataset (e.g. dataset.table).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant