Skip to content

Commit

Permalink
Merge pull request #9264 from OpenMined/fix-pytest
Browse files Browse the repository at this point in the history
make pytest fail on syftexception
  • Loading branch information
koenvanderveen authored Sep 4, 2024
2 parents 1096dd2 + 0c67e09 commit c4616ad
Show file tree
Hide file tree
Showing 20 changed files with 149 additions and 407 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,7 @@ out.*
packages/grid/helm/examples/dev/migration.yaml

# dynaconf settings file
**/settings.yaml
**/settings.yaml


notebooks/scenarios/bigquery/*.json
5 changes: 2 additions & 3 deletions notebooks/api/0.8/05-custom-policy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
" return None\n",
" return output_dict\n",
"\n",
" def _is_valid(self, context):\n",
" def is_valid(self, context):\n",
" return self.state[\"counts\"] < self.n_calls"
]
},
Expand Down Expand Up @@ -336,11 +336,10 @@
"\n",
" return filtered_kwargs\n",
"\n",
" def _is_valid(\n",
" def is_valid(\n",
" self,\n",
" context,\n",
" usr_input_kwargs,\n",
" code_item_id,\n",
" ):\n",
" filtered_input_kwargs = self.filter_kwargs(\n",
" kwargs=usr_input_kwargs,\n",
Expand Down
24 changes: 12 additions & 12 deletions notebooks/api/0.8/08-code-version.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"outputs": [],
"source": [
"datasite_client.register(\n",
" name=\"Jane Doe\",\n",
" email=\"jane@caltech.edu\",\n",
" name=\"Janet Doe\",\n",
" email=\"janet@caltech.edu\",\n",
" password=\"abc123\",\n",
" password_verify=\"abc123\",\n",
" institution=\"Caltech\",\n",
Expand All @@ -92,7 +92,7 @@
"metadata": {},
"outputs": [],
"source": [
"jane_client = server.login(email=\"jane@caltech.edu\", password=\"abc123\")"
"janet_client = server.login(email=\"janet@caltech.edu\", password=\"abc123\")"
]
},
{
Expand Down Expand Up @@ -128,7 +128,7 @@
"metadata": {},
"outputs": [],
"source": [
"jane_client.code.request_code_execution(code=test_func)"
"janet_client.code.request_code_execution(code=test_func)"
]
},
{
Expand All @@ -137,7 +137,7 @@
"metadata": {},
"outputs": [],
"source": [
"jane_client.code"
"janet_client.code"
]
},
{
Expand All @@ -153,7 +153,7 @@
"metadata": {},
"outputs": [],
"source": [
"jane_client.code_history"
"janet_client.code_history"
]
},
{
Expand Down Expand Up @@ -189,7 +189,7 @@
"metadata": {},
"outputs": [],
"source": [
"jane_client.code.request_code_execution(code=test_func)"
"janet_client.code.request_code_execution(code=test_func)"
]
},
{
Expand All @@ -198,7 +198,7 @@
"metadata": {},
"outputs": [],
"source": [
"jane_client.code_history.test_func"
"janet_client.code_history.test_func"
]
},
{
Expand Down Expand Up @@ -232,7 +232,7 @@
"metadata": {},
"outputs": [],
"source": [
"admin_client.code_histories[\"jane@caltech.edu\"]"
"admin_client.code_histories[\"janet@caltech.edu\"]"
]
},
{
Expand All @@ -241,7 +241,7 @@
"metadata": {},
"outputs": [],
"source": [
"admin_client.code_histories[\"jane@caltech.edu\"].test_func[0]"
"admin_client.code_histories[\"janet@caltech.edu\"].test_func[0]"
]
},
{
Expand All @@ -250,7 +250,7 @@
"metadata": {},
"outputs": [],
"source": [
"test_func_history = admin_client.code_histories[\"jane@caltech.edu\"].test_func"
"test_func_history = admin_client.code_histories[\"janet@caltech.edu\"].test_func"
]
},
{
Expand All @@ -260,7 +260,7 @@
"outputs": [],
"source": [
"with sy.raises(sy.SyftException, show=True):\n",
" admin_client.code_histories[\"jane@caltech.edu\"].test_func[-1]"
" admin_client.code_histories[\"janet@caltech.edu\"].test_func[-1]"
]
},
{
Expand Down
16 changes: 9 additions & 7 deletions notebooks/api/0.8/12-custom-api-endpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"def public_endpoint_method(\n",
" context,\n",
" query: str,\n",
") -> Any:\n",
") -> \"Any\":\n",
" return context.settings[\"key\"] == \"value\"\n",
"\n",
"\n",
Expand Down Expand Up @@ -673,14 +673,16 @@
" _print=False\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand All @@ -691,7 +693,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,6 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand All @@ -237,7 +232,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,6 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand All @@ -430,7 +425,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
7 changes: 1 addition & 6 deletions notebooks/scenarios/bigquery/01-setup-datasite.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,6 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand All @@ -505,7 +500,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,6 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand All @@ -427,7 +422,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
7 changes: 1 addition & 6 deletions notebooks/scenarios/bigquery/02-configure-api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,6 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand All @@ -544,7 +539,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
7 changes: 1 addition & 6 deletions notebooks/scenarios/bigquery/021-create-jobs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,6 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand All @@ -432,7 +427,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
34 changes: 28 additions & 6 deletions notebooks/scenarios/bigquery/04-do-review-requests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"high_client.requests.get_all_pending()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -211,6 +220,24 @@
"save_jobs(jobs)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"high_client.requests.get_all_approved()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"high_client.requests.get_all_rejected()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -238,11 +265,6 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand All @@ -253,7 +275,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit c4616ad

Please sign in to comment.