Showing with 14,784 additions and 6,155 deletions.
  1. +278 −0 .circleci/config.yml
  2. +1 −0 .gitignore
  3. +20 −3 Makefile
  4. +10 −8 README.md
  5. +23 −23 appveyor.yml
  6. +8 −13 asv.conf.json
  7. +70 −0 benchmarks/benchmarks.py
  8. +96 −0 ci/clickhouse_load.sql
  9. +286 −0 ci/datamgr.py
  10. +108 −0 ci/postgresql_load.sql
  11. +28 −0 ci/requirements-dev-2.7.yml
  12. +26 −0 ci/requirements-dev-3.4.yml
  13. +26 −0 ci/requirements-dev-3.5.yml
  14. +26 −0 ci/requirements-dev-3.6.yml
  15. +30 −0 ci/requirements-docs-3.6.yml
  16. +0 −12 ci/run.sh
  17. +67 −0 ci/sqlite_load.sql
  18. +0 −90 circle.yml
  19. +1 −1 conda-recipes/ibis-framework/build.sh
  20. +12 −12 conda-recipes/ibis-framework/meta.yaml
  21. +2 −0 docs/requirements-docs.txt
  22. +32 −32 docs/source/api.rst
  23. +8 −8 docs/source/conf.py
  24. +119 −9 docs/source/developer.rst
  25. +75 −23 docs/source/getting-started.rst
  26. +3 −2 docs/source/index.rst
  27. +96 −20 docs/source/release.rst
  28. +0 −4 docs/sphinxext/ipython_sphinxext/LICENSE
  29. +0 −116 docs/sphinxext/ipython_sphinxext/ipython_console_highlighting.py
  30. +0 −1,089 docs/sphinxext/ipython_sphinxext/ipython_directive.py
  31. +13 −0 ibis/__init__.py
  32. 0 {docs/sphinxext → ibis/bigquery}/__init__.py
  33. +44 −0 ibis/bigquery/api.py
  34. +210 −0 ibis/bigquery/client.py
  35. +154 −0 ibis/bigquery/compiler.py
  36. 0 {docs/sphinxext/ipython_sphinxext → ibis/bigquery/tests}/__init__.py
  37. +34 −0 ibis/bigquery/tests/conftest.py
  38. +144 −0 ibis/bigquery/tests/test_client.py
  39. 0 ibis/clickhouse/__init__.py
  40. +81 −0 ibis/clickhouse/api.py
  41. +304 −0 ibis/clickhouse/client.py
  42. +160 −0 ibis/clickhouse/compiler.py
  43. +115 −0 ibis/clickhouse/identifiers.py
  44. +646 −0 ibis/clickhouse/operations.py
  45. 0 ibis/clickhouse/tests/__init__.py
  46. +41 −0 ibis/clickhouse/tests/conftest.py
  47. +330 −0 ibis/clickhouse/tests/test_aggregations.py
  48. +172 −0 ibis/clickhouse/tests/test_client.py
  49. +664 −0 ibis/clickhouse/tests/test_functions.py
  50. +28 −0 ibis/clickhouse/tests/test_identifiers.py
  51. +53 −0 ibis/clickhouse/tests/test_literals.py
  52. +275 −0 ibis/clickhouse/tests/test_operators.py
  53. +471 −0 ibis/clickhouse/tests/test_select.py
  54. +17 −0 ibis/clickhouse/tests/test_types.py
  55. +81 −0 ibis/clickhouse/types.py
  56. +11 −16 ibis/client.py
  57. +14 −0 ibis/compat.py
  58. +1 −1 ibis/config.py
  59. +8 −0 ibis/config_init.py
  60. +57 −31 ibis/expr/analysis.py
  61. +28 −25 ibis/expr/analytics.py
  62. +348 −81 ibis/expr/api.py
  63. +249 −134 ibis/expr/datatypes.py
  64. +2 −0 ibis/expr/format.py
  65. +276 −146 ibis/expr/operations.py
  66. +189 −78 ibis/expr/rules.py
  67. +16 −1 ibis/expr/tests/conftest.py
  68. +6 −6 ibis/expr/tests/mocks.py
  69. +10 −1 ibis/expr/tests/test_datatypes.py
  70. +9 −20 ibis/expr/tests/test_decimal.py
  71. +168 −173 ibis/expr/tests/test_format.py
  72. +35 −0 ibis/expr/tests/test_rules.py
  73. +20 −36 ibis/expr/tests/test_sql_builtins.py
  74. +30 −0 ibis/expr/tests/test_table.py
  75. +17 −34 ibis/expr/tests/test_timestamp.py
  76. +326 −24 ibis/expr/tests/test_value_exprs.py
  77. +3 −10 ibis/expr/tests/test_visualize.py
  78. +13 −17 ibis/expr/tests/test_window_functions.py
  79. +267 −101 ibis/expr/types.py
  80. +15 −6 ibis/impala/api.py
  81. +23 −14 ibis/impala/client.py
  82. +95 −403 ibis/impala/compiler.py
  83. +4 −9 ibis/impala/tests/common.py
  84. +1 −0 ibis/impala/tests/test_client.py
  85. +1 −2 ibis/impala/tests/test_connection_pool.py
  86. +6 −7 ibis/impala/tests/test_ddl.py
  87. +44 −15 ibis/impala/tests/test_exprs.py
  88. +1 −0 ibis/impala/tests/test_kudu_support.py
  89. +1 −1 ibis/impala/tests/test_pandas_interop.py
  90. +3 −2 ibis/impala/tests/test_partition.py
  91. +22 −0 ibis/impala/tests/test_sql.py
  92. +3 −2 ibis/impala/tests/test_udf.py
  93. +8 −4 ibis/impala/tests/test_window.py
  94. +311 −0 ibis/pandas/aggcontext.py
  95. +3 −0 ibis/pandas/api.py
  96. +39 −10 ibis/pandas/client.py
  97. +115 −16 ibis/pandas/core.py
  98. +121 −0 ibis/pandas/decimal.py
  99. +29 −0 ibis/pandas/dispatch.py
  100. +0 −646 ibis/pandas/execution.py
  101. +4 −0 ibis/pandas/execution/__init__.py
  102. +74 −0 ibis/pandas/execution/constants.py
  103. +765 −0 ibis/pandas/execution/generic.py
  104. +108 −0 ibis/pandas/execution/join.py
  105. +343 −0 ibis/pandas/execution/selection.py
  106. 0 ibis/pandas/execution/tests/__init__.py
  107. +237 −0 ibis/pandas/execution/tests/conftest.py
  108. +141 −0 ibis/pandas/execution/tests/test_cast.py
  109. +160 −0 ibis/pandas/execution/tests/test_datetimelike.py
  110. +246 −0 ibis/pandas/execution/tests/test_funcs.py
  111. +292 −0 ibis/pandas/execution/tests/test_join.py
  112. +636 −0 ibis/pandas/execution/tests/test_operations.py
  113. +66 −0 ibis/pandas/execution/tests/test_strings.py
  114. +241 −0 ibis/pandas/execution/tests/test_window.py
  115. +38 −0 ibis/pandas/execution/util.py
  116. +206 −0 ibis/pandas/execution/window.py
  117. +30 −16 ibis/pandas/tests/test_client.py
  118. +82 −2 ibis/pandas/tests/test_core.py
  119. +0 −675 ibis/pandas/tests/test_operations.py
  120. +42 −31 ibis/sql/alchemy.py
  121. +349 −20 ibis/sql/compiler.py
  122. +23 −4 ibis/sql/postgres/api.py
  123. +6 −2 ibis/sql/postgres/client.py
  124. +72 −6 ibis/sql/postgres/compiler.py
  125. +0 −84 ibis/sql/postgres/tests/common.py
  126. +67 −0 ibis/sql/postgres/tests/conftest.py
  127. +67 −51 ibis/sql/postgres/tests/test_client.py
  128. +1,014 −692 ibis/sql/postgres/tests/test_functions.py
  129. +90 −9 ibis/sql/sqlite/client.py
  130. +20 −0 ibis/sql/sqlite/compiler.py
  131. +0 −61 ibis/sql/sqlite/tests/common.py
  132. +69 −0 ibis/sql/sqlite/tests/conftest.py
  133. +78 −69 ibis/sql/sqlite/tests/test_client.py
  134. +720 −459 ibis/sql/sqlite/tests/test_functions.py
  135. +0 −25 ibis/tests/conftest.py
  136. +3 −8 ibis/tests/test_filesystems.py
  137. +8 −0 readthedocs.yml
  138. +2 −2 requirements.txt
  139. +32 −359 scripts/test_data_admin.py
  140. +17 −8 setup.py
  141. +0 −35 tox.ini
278 changes: 278 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
version: 2

environment: &environment
- IBIS_TEST_POSTGRES_DB: ibis_testing
- IBIS_POSTGRES_USER: ubuntu
- IBIS_POSTGRES_PASS: ubuntu
- IBIS_TEST_CLICKHOUSE_DB: ibis_testing
- IBIS_CLICKHOUSE_USER: default
- IBIS_CLICKHOUSE_HOST: localhost
- IBIS_CLICKHOUSE_PASS: ''

- DATA_URL: https://storage.googleapis.com/ibis-ci-data

# The following environment variables are necessary to run impala tests
- IBIS_TEST_IMPALA_HOST: localhost
- IBIS_TEST_IMPALA_PORT: 21050
- IBIS_TEST_NN_HOST: localhost
- IBIS_TEST_WEBHDFS_PORT: 50070
- IBIS_TEST_WEBHDFS_USER: ubuntu

python_test_steps: &python_test_steps
- checkout
- attach_workspace:
at: /tmp/workspace
- run: cat /tmp/workspace/envars.sh | tee -a $BASH_ENV
- run: echo 'export ENV_NAME=ibis_${PYTHON_VERSION}' | tee -a $BASH_ENV
- run: sudo apt-get install -qq clang libboost-dev
- run: |
conda env create --quiet \
--name "${ENV_NAME}" \
--file "ci/requirements-dev-${PYTHON_VERSION}.yml"
- run: echo 'source activate ${ENV_NAME}' | tee -a $BASH_ENV
- run: flake8
- run: |
if [ -n "${GCLOUD_SERVICE_KEY}" ]; then
[ -z "${GOOGLE_APPLICATION_CREDENTIALS}" ] && exit 1
echo "${GCLOUD_SERVICE_KEY}" | base64 --decode --ignore-garbage > "${GOOGLE_APPLICATION_CREDENTIALS}"
# confirm that we can connect to the bigquery test project
python -c 'from google.cloud.bigquery import Client; import os; Client(os.environ["GOOGLE_BIGQUERY_PROJECT_ID"])'
fi
- run: python setup.py develop
- run: |
dockerize -wait tcp://localhost:5432 \
-wait tcp://localhost:21050 \
-wait tcp://localhost:50070 \
-wait tcp://localhost:9000 \
-timeout 1m
- run: ci/datamgr.py download --directory /tmp/workspace
- run: |
ci/datamgr.py sqlite \
--database "$IBIS_TEST_SQLITE_DB_PATH" \
--data-directory "$DATA_DIR" \
--script ci/sqlite_load.sql \
functional_alltypes diamonds awards_players batting
- run: |
ci/datamgr.py postgres \
--database "$IBIS_TEST_POSTGRES_DB" \
--data-directory "$DATA_DIR" \
--script ci/postgresql_load.sql \
functional_alltypes diamonds awards_players batting
- run: |
ci/datamgr.py clickhouse \
--database "$IBIS_TEST_POSTGRES_DB" \
--data-directory "$DATA_DIR" \
--script ci/clickhouse_load.sql \
functional_alltypes diamonds awards_players batting
- run: test_data_admin.py load --data --data-dir "$DATA_DIR"
- run: mkdir -p /tmp/reports
- run: |
pytest -rsxX \
--doctest-modules \
--doctest-ignore-import-errors \
--junitxml=/tmp/reports/junit.xml \
--tb=short ibis
- store_test_results:
path: /tmp/reports
- store_artifacts:
path: /tmp/reports

conda_build_steps: &conda_build_steps
- checkout
- attach_workspace:
at: /tmp/workspace
- run: cat /tmp/workspace/envars.sh | tee -a $BASH_ENV
- run: conda install conda-build --yes --channel conda-forge
- run: |
conda build conda-recipes/ibis-framework \
--python "${PYTHON_VERSION}" \
--channel conda-forge
- run: mkdir -p /tmp/artifacts
- run: |
CONDA_BUILD_TARBALL=$(conda build conda-recipes/ibis-framework \
--output \
--python "${PYTHON_VERSION}" \
--channel conda-forge)
mv "$CONDA_BUILD_TARBALL" /tmp/artifacts
- store_artifacts:
path: /tmp/artifacts

jobs:
setup_envars:
environment: *environment
docker:
- image: circleci/python:latest
steps:
- run: mkdir -p /tmp/workspace
- run: |
cat <<EOF | tee /tmp/workspace/envars.sh
export PATH="/tmp/workspace/miniconda/bin:$PATH"
export DATA_DIR=/tmp/workspace/ibis-testing-data
export IBIS_TEST_CRUNCHBASE_DB=/tmp/workspace/crunchbase.db
export IBIS_TEST_SQLITE_DB_PATH=/tmp/workspace/ibis_testing.db
export FUNCTIONAL_ALLTYPES_CSV="\$DATA_DIR/functional_alltypes.csv"
export DIAMONDS_CSV="\$DATA_DIR/diamonds.csv"
export BATTING_CSV="\$DATA_DIR/batting.csv"
export AWARDS_PLAYERS_CSV="\$DATA_DIR/awards_players.csv"
export GOOGLE_APPLICATION_CREDENTIALS="\$HOME/gcloud-service-key.json"
export GOOGLE_BIGQUERY_PROJECT_ID="ibis-gbq"
EOF
- persist_to_workspace:
root: /tmp/workspace
paths:
- envars.sh

install_miniconda:
environment: *environment
docker:
- image: circleci/python:latest
steps:
- run: mkdir -p /tmp/workspace
- run: curl -o $HOME/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
- run: bash $HOME/miniconda.sh -b -p /tmp/workspace/miniconda
- persist_to_workspace:
root: /tmp/workspace
paths:
- miniconda

################# TESTS ##################

python27_test:
environment: *environment
docker:
- image: circleci/python:latest
environment:
PYTHON_VERSION: 2.7
- image: cpcloud86/impala:java8-1
- image: yandex/clickhouse-server
steps: *python_test_steps

python34_test:
environment: *environment
docker:
- image: circleci/python:latest
environment:
PYTHON_VERSION: 3.4
- image: cpcloud86/impala:java8-1
- image: yandex/clickhouse-server
steps: *python_test_steps

python35_test:
environment: *environment
docker:
- image: circleci/python:latest
environment:
PYTHON_VERSION: 3.5
- image: cpcloud86/impala:java8-1
- image: yandex/clickhouse-server
steps: *python_test_steps

python36_test:
environment: *environment
docker:
- image: circleci/python:latest
environment:
PYTHON_VERSION: 3.6
- image: cpcloud86/impala:java8-1
- image: yandex/clickhouse-server
steps: *python_test_steps

################# CONDA BUILD ##################

python27_conda_build:
environment: *environment
docker:
- image: circleci/python:latest
environment:
PYTHON_VERSION: 2.7
steps: *conda_build_steps

python34_conda_build:
environment: *environment
docker:
- image: circleci/python:latest
environment:
PYTHON_VERSION: 3.4
steps: *conda_build_steps

python35_conda_build:
environment: *environment
docker:
- image: circleci/python:latest
environment:
PYTHON_VERSION: 3.5
steps: *conda_build_steps

python36_conda_build:
environment: *environment
docker:
- image: circleci/python:latest
environment:
PYTHON_VERSION: 3.6
steps: *conda_build_steps

################### BENCHMARKING #################
benchmark:
docker:
- image: circleci/python:latest
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run: cat /tmp/workspace/envars.sh | tee -a $BASH_ENV
- run: pip install asv
- run: ci/asvconfig.py | tee $HOME/.asv-machine.json
- run: git remote add upstream git://github.com/ibis-project/ibis.git
- run: git fetch upstream refs/heads/master
- run: asv continuous -f 1.5 -e upstream/master "${CIRCLE_SHA1}" || echo > /dev/null


workflows:
version: 2
build:
jobs:
- setup_envars
- install_miniconda

- python27_test:
requires:
- setup_envars
- install_miniconda
- python34_test:
requires:
- setup_envars
- install_miniconda
- python35_test:
requires:
- setup_envars
- install_miniconda
- python36_test:
requires:
- setup_envars
- install_miniconda

- python27_conda_build:
requires:
- setup_envars
- install_miniconda
- python34_conda_build:
requires:
- setup_envars
- install_miniconda
- python35_conda_build:
requires:
- setup_envars
- install_miniconda
- python36_conda_build:
requires:
- setup_envars
- install_miniconda

- benchmark:
requires:
- setup_envars
- install_miniconda
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*.log
*.swp
*.pdb
.idea

# Compiled source
*.a
Expand Down
23 changes: 20 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
.PHONY: all clean-pyc develop lint test docclean docs docserve

SHELL := /bin/bash

all:
python setup.py build_ext --inplace

impala-test:
pushd scripts && python load_test_data.py --udf && popd

clean-pyc:
find . -name "*.pyc" -exec rm -rf {} \;

develop: clean-pyc
python setup.py develop

lint:
flake8

test:
pytest --pyargs ibis -m 'not impala and not hdfs'

docclean:
$(MAKE) -C docs clean

docs:
$(MAKE) -C docs html

docserve: docs
pushd docs/build/html && python -m http.server --bind localhost
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
[![circleci](https://circleci.com/gh/ibis-project/ibis.svg?style=shield&circle-token=b84ff8383cbb0d6788ee0f9635441cb962949a4f)](https://circleci.com/gh/ibis-project/ibis/tree/master)
[![appveyor](https://ci.appveyor.com/api/projects/status/github/ibis-project/ibis?branch=master&svg=true)](https://ci.appveyor.com/project/cpcloud/ibis-xh5g1)
[![CircleCI Status](https://circleci.com/gh/ibis-project/ibis.svg?style=shield&circle-token=b84ff8383cbb0d6788ee0f9635441cb962949a4f)](https://circleci.com/gh/ibis-project/ibis/tree/master)
[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/ibis-project/ibis?branch=master&svg=true)](https://ci.appveyor.com/project/cpcloud/ibis-xh5g1)
[![Documentation Status](https://readthedocs.org/projects/ibis-project/badge/?version=latest)](http://ibis-project.readthedocs.io/en/latest/?badge=latest)

Current release from Anaconda.org [![Anaconda-Server Badge](https://anaconda.org/conda-forge/ibis-framework/badges/version.svg)](https://anaconda.org/conda-forge/ibis-framework)


# Ibis: Python data analysis framework for Hadoop and SQL engines

Ibis is a toolbox to bridge the gap between local Python environments and
remote storage and execution systems like Hadoop components (HDFS, Impala,
Hive, Spark) and SQL databases (Postgres, etc.). Its goal is to simplify
analytical workflows and make you more productive.
Ibis is a toolbox to bridge the gap between local Python environments,
remote storage, execution systems like Hadoop components (HDFS, Impala,
Hive, Spark) and SQL databases. Its goal is to simplify analytical
workflows and make you more productive.

Install Ibis from PyPI with:

$ pip install ibis-framework

At this time, Ibis provides tools for the interacting with the following
At this time, Ibis provides tools for interacting with the following
systems:

- [Apache Impala (incubating)](http://impala.io/)
- [Apache Kudu](http://getkudu.io)
- Hadoop Distributed File System (HDFS)
- [Hadoop Distributed File System (HDFS)](https://hadoop.apache.org/)
- PostgreSQL (Experimental)
- SQLite
- Direct execution of ibis expressions against pandas object (Experimental)
- [Clickhouse](https://clickhouse.yandex)

Learn more about using the library at http://docs.ibis-project.org and read the
project blog at http://ibis-project.org for news and updates.
Loading