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

Fix issues with SqlMagic (prettytable) and arrow dependency conflict #74

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions component_setup_charts.ipynb
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "IhnbdjqU1e6p"
},
"source": [
"## Charts Setup\n",
"*You must run the cells in this section each time you connect to a new runtime. For example, when you return to the notebook after an idle timeout, when the runtime crashes, or when you restart or factory reset the runtime.*"
],
"metadata": {
"id": "IhnbdjqU1e6p"
}
]
},
{
"cell_type": "code",
Expand All @@ -30,11 +18,14 @@
},
"outputs": [],
"source": [
"! pip install altair pyarrow==11.0.0 >> pip.log"
"! pip install altair pyarrow==14.0.0 >> pip.log"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "P1aenztz1zK3"
},
"source": [
"Import chart packages and define chart functions. The currently available chart functions are:\n",
"\n",
Expand All @@ -44,13 +35,15 @@
"* Objects per year\n",
"* Top buyers\n",
"* Usability indicators"
],
"metadata": {
"id": "P1aenztz1zK3"
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Bip37aP917XY"
},
"outputs": [],
"source": [
"# @title Chart functions { display-mode: \"form\" }\n",
"import altair as alt\n",
Expand Down Expand Up @@ -306,12 +299,19 @@
" .configure_axis(**chart_axis)\n",
" .configure_view(strokeWidth=0)\n",
" )"
],
"metadata": {
"id": "Bip37aP917XY"
},
"execution_count": null,
"outputs": []
]
}
],
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
}
]
},
"nbformat": 4,
"nbformat_minor": 0
}
71 changes: 37 additions & 34 deletions component_setup_kingfisher.ipynb
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
Expand All @@ -32,6 +20,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "sX1Mk084L8gN"
},
"outputs": [],
"source": [
"import getpass\n",
"\n",
Expand All @@ -40,12 +33,7 @@
" list_source_ids,\n",
" set_search_path,\n",
")"
],
"metadata": {
"id": "sX1Mk084L8gN"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -58,16 +46,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "27yRx-oaXPtd"
},
"outputs": [],
"source": [
"user = input(\"Username:\")\n",
"password = getpass.getpass(\"Password:\")\n",
"\n",
"# Don't show connection string after execute.\n",
"%config SqlMagic.displaycon = False\n",
"\n",
"# Set SqlMagic table style\n",
"%config SqlMagic.style = '_DEPRECATED_DEFAULT'\n",
"\n",
"connection_string = (\n",
" \"postgresql://\"\n",
" + user\n",
Expand All @@ -76,9 +69,7 @@
" + \"@postgres.kingfisher.open-contracting.org/kingfisher_process?sslmode=require\"\n",
")\n",
"%sql $connection_string"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -111,14 +102,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "IKn0TqQIsIGY"
},
"outputs": [],
"source": [
"collection_ids = (2358, 2359)"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -131,14 +122,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ITTvCttGsWj1"
},
"outputs": [],
"source": [
"list_collections()"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -160,15 +151,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "RtNddeQWm4wx"
},
"outputs": [],
"source": [
"schema_name = \"view_data_collection_2358_2359\"\n",
"set_search_path(schema_name)"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -181,9 +172,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "aVg-KWfvzcfa"
},
"outputs": [],
"source": [
"%%sql\n",
"SELECT\n",
Expand All @@ -194,9 +187,7 @@
"INNER JOIN\n",
" collection\n",
" ON summaries.selected_collections.collection_id = collection.id\n"
],
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -207,5 +198,17 @@
"If you can't find a schema containing the collections that you want to query, you can create a schema using [Kingfisher Summarize](https://ocdsdeploy.readthedocs.io/en/latest/use/kingfisher-summarize.html)."
]
}
]
],
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
5 changes: 4 additions & 1 deletion template_basic_criteria_checks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
"! pip install altair pyarrow==11.0.0 >> pip.log"
"! pip install altair pyarrow==14.0.0 >> pip.log"
]
},
{
Expand Down Expand Up @@ -1752,6 +1752,9 @@
"# Don't show connection string after execute.\n",
"%config SqlMagic.displaycon = False\n",
"\n",
"# Set SqlMagic table style\n",
"%config SqlMagic.style = '_DEPRECATED_DEFAULT'\n",
"\n",
"connection_string = (\n",
" \"postgresql://\"\n",
" + user\n",
Expand Down
5 changes: 4 additions & 1 deletion template_data_quality_feedback.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
"! pip install altair pyarrow==11.0.0 >> pip.log"
"! pip install altair pyarrow==14.0.0 >> pip.log"
]
},
{
Expand Down Expand Up @@ -461,6 +461,9 @@
"# Don't show connection string after execute.\n",
"%config SqlMagic.displaycon = False\n",
"\n",
"# Set SqlMagic table style\n",
"%config SqlMagic.style = '_DEPRECATED_DEFAULT'\n",
"\n",
"connection_string = (\n",
" \"postgresql://\"\n",
" + user\n",
Expand Down
3 changes: 3 additions & 0 deletions template_meta_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
"# Don't show connection string after execute.\n",
"%config SqlMagic.displaycon = False\n",
"\n",
"# Set SqlMagic table style\n",
"%config SqlMagic.style = '_DEPRECATED_DEFAULT'\n",
"\n",
"connection_string = (\n",
" \"postgresql://\"\n",
" + user\n",
Expand Down
5 changes: 4 additions & 1 deletion template_publisher_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
"! pip install altair pyarrow==11.0.0 >> pip.log"
"! pip install altair pyarrow==14.0.0 >> pip.log"
]
},
{
Expand Down Expand Up @@ -461,6 +461,9 @@
"# Don't show connection string after execute.\n",
"%config SqlMagic.displaycon = False\n",
"\n",
"# Set SqlMagic table style\n",
"%config SqlMagic.style = '_DEPRECATED_DEFAULT'\n",
"\n",
"connection_string = (\n",
" \"postgresql://\"\n",
" + user\n",
Expand Down
2 changes: 1 addition & 1 deletion template_red_flags_checks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
"! pip install altair pyarrow==11.0.0 >> pip.log"
"! pip install altair pyarrow==14.0.0 >> pip.log"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion template_red_flags_checks_fieldlist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
"! pip install altair pyarrow==11.0.0 >> pip.log"
"! pip install altair pyarrow==14.0.0 >> pip.log"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion template_red_flags_checks_registry.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
"! pip install altair pyarrow==11.0.0 >> pip.log"
"! pip install altair pyarrow==14.0.0 >> pip.log"
]
},
{
Expand Down
5 changes: 4 additions & 1 deletion template_structure_and_format_feedback.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
"! pip install altair pyarrow==11.0.0 >> pip.log"
"! pip install altair pyarrow==14.0.0 >> pip.log"
]
},
{
Expand Down Expand Up @@ -461,6 +461,9 @@
"# Don't show connection string after execute.\n",
"%config SqlMagic.displaycon = False\n",
"\n",
"# Set SqlMagic table style\n",
"%config SqlMagic.style = '_DEPRECATED_DEFAULT'\n",
"\n",
"connection_string = (\n",
" \"postgresql://\"\n",
" + user\n",
Expand Down
5 changes: 4 additions & 1 deletion template_usability_checks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"outputs": [],
"source": [
"! pip install altair pyarrow==11.0.0 >> pip.log"
"! pip install altair pyarrow==14.0.0 >> pip.log"
]
},
{
Expand Down Expand Up @@ -461,6 +461,9 @@
"# Don't show connection string after execute.\n",
"%config SqlMagic.displaycon = False\n",
"\n",
"# Set SqlMagic table style\n",
"%config SqlMagic.style = '_DEPRECATED_DEFAULT'\n",
"\n",
"connection_string = (\n",
" \"postgresql://\"\n",
" + user\n",
Expand Down
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.