Skip to content

Commit

Permalink
Fix ibis imports (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab authored Nov 16, 2020
1 parent 75b4c5e commit 5e32970
Show file tree
Hide file tree
Showing 31 changed files with 196 additions and 3,408 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v1
- name: Setup conda
uses: goanpeca/setup-miniconda@v1
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ibis-vega-transform
environment-file: binder/environment.yml
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ source = pd.DataFrame({
'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})

connection = ibis.pandas.connect({'source': source })
# or ibis.pandas if ibis version < 1.4
connection = ibis.backends.pandas.connect({'source': source })
table = connection.table('source')

alt.Chart(table).mark_bar().encode(
Expand All @@ -44,7 +45,6 @@ Importing `ibis_vega_transform` sets the `altair` renderer and data transformer

Now, whenever you pass an `ibis` expression to a chart constructor, it will use the custom ibis renderer, which pushes all data aggregates to ibis, instead of in the browser.


You can also set a debug flag, to have it instead pull in the first N rows of the ibis expression and use the default renderer. This is useful to see how the default pipeline would have rendered your chart. If you are getting some error, I reccomend setting this first to see if the error was on the Altair side or on the `ibis-vega-transform` side. If the fallback chart rendered correctly, it means the error is in this codebase. If it's wrong, then the error is in your code or in altair or in Vega.

```python
Expand Down
9 changes: 7 additions & 2 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ channels:
dependencies:
- jaeger
- jupyterlab>=2
- pymapd
- python>=3.7
# force the pandas used by pymapd
- pandas <0.26,>=0.25
# use the latest version of pymapd to keep compatibility with ibis
# - pymapd >=0.24
# ibis doesn't support python 3.6 anymore
# ibis.omniscidb doesn't support 3.8 yet
- python 3.7
- nodejs>=12
- notebook
- tornado
Expand Down
8 changes: 6 additions & 2 deletions config/jest/jest-puppeteer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
* Distributed under the terms of the 3-Clause BSD License.
*/

let os = require('os');

const portNumber = 8080;
let browserExecutablePath = '';

// Use Chrome if running test suit locally
if (process.env.CI !== 'true') {
browserExecutablePath =
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
if (os.type() === 'Darwin') {
browserExecutablePath =
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
}
}

const config = {
Expand Down
9 changes: 7 additions & 2 deletions examples/Geocharts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,14 @@
},
"outputs": [],
"source": [
"import ibis\n",
"import warnings\n",
"try:\n",
" from ibis.backends import omniscidb as ibis_omniscidb\n",
"except ImportError as msg:\n",
" warnings.warn(str(msg))\n",
" from ibis import omniscidb as ibis_omniscidb\n",
"\n",
"omnisci_cli = ibis.omniscidb.connect(\n",
"omnisci_cli = ibis_omniscidb.connect(\n",
" host='metis.mapd.com', user='mapd', password='HyperInteractive',\n",
" port=443, database='mapd', protocol= 'https'\n",
")\n",
Expand Down
9 changes: 7 additions & 2 deletions examples/Talk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
"source": [
"import altair as alt\n",
"import ibis_vega_transform\n",
"import ibis.omniscidb\n",
"\n",
"import warnings\n",
"try:\n",
" from ibis.backends import omniscidb as ibis_omniscidb\n",
"except ImportError as msg:\n",
" warnings.warn(str(msg))\n",
" from ibis import omniscidb as ibis_omniscidb\n",
"\n",
"conn = ibis.omniscidb.connect(\n",
"conn = ibis_omniscidb.connect(\n",
" host='metis.mapd.com', user='demouser', password='HyperInteractive',\n",
" port=443, database='mapd', protocol= 'https'\n",
")"
Expand Down
12 changes: 9 additions & 3 deletions examples/Talk/Untitled.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@
"source": [
"import altair as alt\n",
"import ibis_vega_transform\n",
"import ibis.omniscidb\n",
"import ibis\n",
"\n",
"import warnings\n",
"try:\n",
" from ibis.backends import omniscidb as ibis_omniscidb\n",
"except ImportError as msg:\n",
" warnings.warn(str(msg))\n",
" from ibis import omniscidb as ibis_omniscidb\n",
"\n",
"conn = ibis.omniscidb.connect(\n",
"conn = ibis_omniscidb.connect(\n",
" host='bewdy.mapd.com', user='mapd', password='HyperInteractive',\n",
" port=6274, database='mapd', protocol= 'binary'\n",
")"
Expand Down Expand Up @@ -829,7 +835,7 @@
},
"outputs": [],
"source": [
"# conn = ibis.omniscidb.connect(\n",
"# conn = ibis_omniscidb.connect(\n",
"# host='localhost', password='HyperInteractive', user='admin',\n",
"# port=6274, protocol= 'binary'\n",
"# )"
Expand Down
9 changes: 7 additions & 2 deletions examples/Talk/Untitled1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
"source": [
"import altair as alt\n",
"import ibis_vega_transform\n",
"import ibis.omniscidb\n",
"\n",
"import warnings\n",
"try:\n",
" from ibis.backends import omniscidb as ibis_omniscidb\n",
"except ImportError as msg:\n",
" warnings.warn(str(msg))\n",
" from ibis import omniscidb as ibis_omniscidb\n",
"\n",
"conn = ibis.omniscidb.connect(\n",
"conn = ibis_omniscidb.connect(\n",
" host='bewdy.mapd.com', user='mapd', password='HyperInteractive',\n",
" port=6274, database='mapd', protocol= 'binary'\n",
")"
Expand Down
9 changes: 7 additions & 2 deletions examples/Talk/Untitled2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
"source": [
"import altair as alt\n",
"import ibis_vega_transform\n",
"import ibis.omniscidb\n",
"\n",
"import warnings\n",
"try:\n",
" from ibis.backends import omniscidb as ibis_omniscidb\n",
"except ImportError as msg:\n",
" warnings.warn(str(msg))\n",
" from ibis import omniscidb as ibis_omniscidb\n",
"\n",
"conn = ibis.omniscidb.connect(\n",
"conn = ibis_omniscidb.connect(\n",
" host='bewdy.mapd.com', user='mapd', password='HyperInteractive',\n",
" port=6274, database='mapd', protocol= 'binary'\n",
")"
Expand Down
Loading

0 comments on commit 5e32970

Please sign in to comment.