Skip to content

Commit

Permalink
Made some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
madhavajay committed Aug 31, 2024
1 parent 3d43dfb commit 9d25ce2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
12 changes: 9 additions & 3 deletions notebooks/scenarios/bigquery/021-create-jobs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,13 @@
"outputs": [],
"source": [
"print(f\"num jobs: {len(jobs)}\")\n",
"num_should_submit = 0\n",
"for job in jobs:\n",
" print(\n",
" f\"Job type: {job.job_type}, should succeed: {job.should_succeed}, should submit: {job.should_submit}\"\n",
" )"
" )\n",
" if job.should_submit:\n",
" num_should_submit += 1"
]
},
{
Expand Down Expand Up @@ -247,7 +250,9 @@
"metadata": {},
"outputs": [],
"source": [
"admin_emails_before = len(email_server.get_emails_for_user(\"[email protected]\"))"
"admin_emails_before = len(email_server.get_emails_for_user(\"[email protected]\"))\n",
"print(\"admin emails before\", admin_emails_before)\n",
"admin_emails_before"
]
},
{
Expand Down Expand Up @@ -372,7 +377,8 @@
"outputs": [],
"source": [
"admin_emails_after = len(email_server.get_emails_for_user(\"[email protected]\"))\n",
"assert admin_emails_after > admin_emails_before\n",
"print(\"admin emails after\", admin_emails_after)\n",
"assert admin_emails_after >= admin_emails_before + num_should_submit\n",
"# assert len(users_emails) > after_number_of_emails\n",
"# assert len(users_emails) == after_number_of_emails + 1"
]
Expand Down
11 changes: 3 additions & 8 deletions notebooks/scenarios/bigquery/04-do-review-requests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@
"def approve_by_running(request):\n",
" job = request.code(blocking=False)\n",
" result = job.wait()\n",
" assert result\n",
" print(\"got result of type\", type(result), \"bool\", bool(result))\n",
" # got result of type <class 'syft.service.action.pandas.PandasDataFrameObject'> bool False\n",
" # assert result won't work unless we know what type is coming back\n",
" job_info = job.info(result=True)\n",
" # need force when running multiple times\n",
" # todo check and dont run if its already done\n",
Expand Down Expand Up @@ -209,13 +211,6 @@
"save_jobs(jobs)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
14 changes: 4 additions & 10 deletions notebooks/scenarios/bigquery/05-ds-get-results.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
"outputs": [],
"source": [
"# submitted_jobs = [job for job in jobs if job.is_submitted]\n",
"reviewed_jobs = [job for job in jobs if job.admin_reviewed]"
"reviewed_jobs = [job for job in jobs if job.admin_reviewed]\n",
"len(reviewed_jobs)"
]
},
{
Expand Down Expand Up @@ -167,15 +168,7 @@
"metadata": {},
"outputs": [],
"source": [
"expected_jobs = [job for job in jobs if job.result_as_expected]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"expected_jobs = [job for job in jobs if job.result_as_expected]\n",
"len(expected_jobs)"
]
},
Expand All @@ -186,6 +179,7 @@
"outputs": [],
"source": [
"# TODO fix\n",
"print(f\"got expected_jobs: {len(expected_jobs)} == reviewed_jobs: {len(reviewed_jobs)}\")\n",
"# assert len(reviewed_jobs) == len(expected_jobs)"
]
},
Expand Down

0 comments on commit 9d25ce2

Please sign in to comment.