2022-01-23 02:10:13 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, pytestCheckHook
|
|
|
|
, atpublic
|
2023-04-29 16:46:19 +00:00
|
|
|
, bidict
|
|
|
|
, black
|
2023-08-22 20:05:09 +00:00
|
|
|
, clickhouse-connect
|
2022-01-23 02:10:13 +00:00
|
|
|
, dask
|
2022-04-27 09:35:20 +00:00
|
|
|
, datafusion
|
2023-04-29 16:46:19 +00:00
|
|
|
, db-dtypes
|
2022-04-27 09:35:20 +00:00
|
|
|
, duckdb
|
|
|
|
, duckdb-engine
|
2022-08-21 13:32:41 +00:00
|
|
|
, filelock
|
2022-05-18 14:49:53 +00:00
|
|
|
, geoalchemy2
|
|
|
|
, geopandas
|
2023-04-29 16:46:19 +00:00
|
|
|
, google-cloud-bigquery
|
|
|
|
, google-cloud-bigquery-storage
|
2022-05-18 14:49:53 +00:00
|
|
|
, graphviz-nox
|
2023-02-16 17:41:37 +00:00
|
|
|
, hypothesis
|
2020-04-24 23:36:52 +00:00
|
|
|
, multipledispatch
|
|
|
|
, numpy
|
2023-08-22 20:05:09 +00:00
|
|
|
, oracledb
|
2022-05-18 14:49:53 +00:00
|
|
|
, packaging
|
2020-04-24 23:36:52 +00:00
|
|
|
, pandas
|
2022-01-23 02:10:13 +00:00
|
|
|
, parsy
|
2022-02-20 05:27:41 +00:00
|
|
|
, poetry-core
|
2023-08-22 20:05:09 +00:00
|
|
|
, poetry-dynamic-versioning
|
2023-04-29 16:46:19 +00:00
|
|
|
, polars
|
|
|
|
, pooch
|
2022-05-18 14:49:53 +00:00
|
|
|
, psycopg2
|
2020-04-24 23:36:52 +00:00
|
|
|
, pyarrow
|
2023-04-29 16:46:19 +00:00
|
|
|
, pydata-google-auth
|
|
|
|
, pydruid
|
2022-05-18 14:49:53 +00:00
|
|
|
, pymysql
|
|
|
|
, pyspark
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytest-benchmark
|
2023-04-29 16:46:19 +00:00
|
|
|
, pytest-httpserver
|
2022-01-23 02:10:13 +00:00
|
|
|
, pytest-mock
|
2023-02-16 17:41:37 +00:00
|
|
|
, pytest-randomly
|
|
|
|
, pytest-snapshot
|
2022-01-23 02:10:13 +00:00
|
|
|
, pytest-xdist
|
2023-04-29 16:46:19 +00:00
|
|
|
, python-dateutil
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytz
|
|
|
|
, regex
|
2022-09-22 12:36:57 +00:00
|
|
|
, rich
|
2022-05-18 14:49:53 +00:00
|
|
|
, shapely
|
2023-04-29 16:46:19 +00:00
|
|
|
, snowflake-connector-python
|
|
|
|
, snowflake-sqlalchemy
|
2020-04-24 23:36:52 +00:00
|
|
|
, sqlalchemy
|
2023-04-29 16:46:19 +00:00
|
|
|
, sqlalchemy-views
|
2022-09-22 12:36:57 +00:00
|
|
|
, sqlglot
|
2022-04-27 09:35:20 +00:00
|
|
|
, sqlite
|
2020-04-24 23:36:52 +00:00
|
|
|
, toolz
|
2023-04-29 16:46:19 +00:00
|
|
|
, trino-python-client
|
|
|
|
, typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2022-01-23 02:10:13 +00:00
|
|
|
let
|
2023-04-29 16:46:19 +00:00
|
|
|
testBackends = [ "datafusion" "duckdb" "pandas" "sqlite" ];
|
2022-01-23 02:10:13 +00:00
|
|
|
|
|
|
|
ibisTestingData = fetchFromGitHub {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "ibis-testing-data";
|
2022-01-23 02:10:13 +00:00
|
|
|
owner = "ibis-project";
|
|
|
|
repo = "testing-data";
|
2024-01-13 08:15:51 +00:00
|
|
|
# https://github.com/ibis-project/ibis/blob/7.1.0/nix/overlay.nix#L20-L26
|
|
|
|
rev = "2c6a4bb5d5d525058d8d5b2312a9fee5dafc5476";
|
|
|
|
hash = "sha256-Lq503bqh9ESZJSk6yVq/uZwkAubzmSmoTBZSsqMm0DY=";
|
2022-01-23 02:10:13 +00:00
|
|
|
};
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ibis-framework";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "7.1.0";
|
2022-02-20 05:27:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
src = fetchFromGitHub {
|
2023-04-29 16:46:19 +00:00
|
|
|
name = "ibis-source";
|
2022-01-23 02:10:13 +00:00
|
|
|
repo = "ibis";
|
|
|
|
owner = "ibis-project";
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-E7jryoidw6+CjTIex4wcTXcU+8Kg8LDwg7wJvcwj+7Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
2023-08-22 20:05:09 +00:00
|
|
|
poetry-dynamic-versioning
|
2023-02-16 17:41:37 +00:00
|
|
|
];
|
2022-02-20 05:27:41 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
POETRY_DYNAMIC_VERSIONING_BYPASS = version;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-01-23 02:10:13 +00:00
|
|
|
atpublic
|
2023-04-29 16:46:19 +00:00
|
|
|
bidict
|
2023-08-22 20:05:09 +00:00
|
|
|
filelock
|
2020-04-24 23:36:52 +00:00
|
|
|
multipledispatch
|
|
|
|
numpy
|
|
|
|
pandas
|
2022-01-23 02:10:13 +00:00
|
|
|
parsy
|
2023-04-29 16:46:19 +00:00
|
|
|
pooch
|
2023-08-22 20:05:09 +00:00
|
|
|
pyarrow
|
2023-04-29 16:46:19 +00:00
|
|
|
python-dateutil
|
2020-04-24 23:36:52 +00:00
|
|
|
pytz
|
2022-09-22 12:36:57 +00:00
|
|
|
rich
|
2023-04-29 16:46:19 +00:00
|
|
|
sqlglot
|
2022-01-23 02:10:13 +00:00
|
|
|
toolz
|
2023-04-29 16:46:19 +00:00
|
|
|
typing-extensions
|
2023-08-22 20:05:09 +00:00
|
|
|
]
|
2023-04-29 16:46:19 +00:00
|
|
|
++ pooch.optional-dependencies.progress
|
|
|
|
++ pooch.optional-dependencies.xxhash;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-23 02:10:13 +00:00
|
|
|
pytestCheckHook
|
2023-02-16 17:41:37 +00:00
|
|
|
hypothesis
|
2022-04-27 09:35:20 +00:00
|
|
|
pytest-benchmark
|
2023-04-29 16:46:19 +00:00
|
|
|
pytest-httpserver
|
2022-01-23 02:10:13 +00:00
|
|
|
pytest-mock
|
2022-05-18 14:49:53 +00:00
|
|
|
pytest-randomly
|
2023-02-16 17:41:37 +00:00
|
|
|
pytest-snapshot
|
2022-01-23 02:10:13 +00:00
|
|
|
pytest-xdist
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ lib.concatMap (name: passthru.optional-dependencies.${name}) testBackends;
|
2022-01-23 02:10:13 +00:00
|
|
|
|
|
|
|
pytestFlagsArray = [
|
2022-04-27 09:35:20 +00:00
|
|
|
"--dist=loadgroup"
|
|
|
|
"-m"
|
2022-05-18 14:49:53 +00:00
|
|
|
"'${lib.concatStringsSep " or " testBackends} or core'"
|
2023-08-22 20:05:09 +00:00
|
|
|
# breakage from sqlalchemy2 truediv changes
|
2023-04-29 16:46:19 +00:00
|
|
|
"--deselect=ibis/tests/sql/test_sqlalchemy.py::test_tpc_h17"
|
|
|
|
# tries to download duckdb extensions
|
|
|
|
"--deselect=ibis/backends/duckdb/tests/test_register.py::test_register_sqlite"
|
|
|
|
"--deselect=ibis/backends/duckdb/tests/test_register.py::test_read_sqlite"
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
# duckdb does not respect sample_size=2 (reads 3 lines of csv).
|
|
|
|
"--deselect=ibis/backends/tests/test_register.py::test_csv_reregister_schema"
|
|
|
|
|
|
|
|
# duckdb fails with:
|
|
|
|
# "This function can not be called with an active transaction!, commit or abort the existing one first"
|
|
|
|
"--deselect=ibis/backends/tests/test_udf.py::test_vectorized_udf"
|
|
|
|
"--deselect=ibis/backends/tests/test_udf.py::test_map_merge_udf"
|
|
|
|
"--deselect=ibis/backends/tests/test_udf.py::test_udf"
|
|
|
|
"--deselect=ibis/backends/tests/test_udf.py::test_map_udf"
|
|
|
|
|
|
|
|
# pyarrow13 is not supported yet.
|
|
|
|
"--deselect=ibis/backends/tests/test_temporal.py::test_date_truncate"
|
|
|
|
"--deselect=ibis/backends/tests/test_temporal.py::test_integer_to_interval_timestamp"
|
|
|
|
"--deselect=ibis/backends/tests/test_temporal.py::test_integer_to_interval_timestamp"
|
|
|
|
"--deselect=ibis/backends/tests/test_temporal.py::test_interval_add_cast_column"
|
|
|
|
"--deselect=ibis/backends/tests/test_temporal.py::test_integer_to_interval_timestamp"
|
|
|
|
"--deselect=ibis/backends/tests/test_temporal.py::test_integer_to_interval_timestamp"
|
|
|
|
"--deselect=ibis/backends/tests/test_temporal.py::test_integer_to_interval_timestamp"
|
|
|
|
"--deselect=ibis/backends/tests/test_temporal.py::test_integer_to_interval_timestamp"
|
|
|
|
"--deselect=ibis/backends/tests/test_timecontext.py::test_context_adjustment_filter_before_window"
|
|
|
|
"--deselect=ibis/backends/tests/test_timecontext.py::test_context_adjustment_window_udf"
|
|
|
|
"--deselect=ibis/backends/tests/test_timecontext.py::test_context_adjustment_window_udf"
|
|
|
|
"--deselect=ibis/backends/tests/test_aggregation.py::test_aggregate_grouped"
|
2022-01-23 02:10:13 +00:00
|
|
|
];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
# patch out tests that check formatting with black
|
|
|
|
postPatch = ''
|
|
|
|
find ibis/tests -type f -name '*.py' -exec sed -i \
|
|
|
|
-e '/^ *assert_decompile_roundtrip/d' \
|
|
|
|
-e 's/^\( *\)code = ibis.decompile(expr, format=True)/\1code = ibis.decompile(expr)/g' {} +
|
2023-07-15 17:15:38 +00:00
|
|
|
substituteInPlace pyproject.toml --replace 'sqlglot = ">=10.4.3,<12"' 'sqlglot = "*"'
|
2023-02-16 17:41:37 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
preCheck = ''
|
2023-04-29 16:46:19 +00:00
|
|
|
HOME="$TMPDIR"
|
|
|
|
export IBIS_TEST_DATA_DIRECTORY="ci/ibis-testing-data"
|
2022-09-22 12:36:57 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
# copy the test data to a directory
|
2023-08-22 20:05:09 +00:00
|
|
|
ln -s "${ibisTestingData}" "$IBIS_TEST_DATA_DIRECTORY"
|
2022-04-27 09:35:20 +00:00
|
|
|
'';
|
2022-01-23 02:10:13 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
postCheck = ''
|
|
|
|
rm -r "$IBIS_TEST_DATA_DIRECTORY"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"ibis"
|
2022-05-18 14:49:53 +00:00
|
|
|
] ++ map (backend: "ibis.backends.${backend}") testBackends;
|
|
|
|
|
|
|
|
passthru = {
|
2022-06-16 17:23:12 +00:00
|
|
|
optional-dependencies = {
|
2023-04-29 16:46:19 +00:00
|
|
|
bigquery = [ db-dtypes google-cloud-bigquery google-cloud-bigquery-storage pydata-google-auth ];
|
2023-08-22 20:05:09 +00:00
|
|
|
clickhouse = [ clickhouse-connect sqlalchemy ];
|
|
|
|
dask = [ dask regex ];
|
2022-05-18 14:49:53 +00:00
|
|
|
datafusion = [ datafusion ];
|
2023-04-29 16:46:19 +00:00
|
|
|
druid = [ pydruid sqlalchemy ];
|
2023-08-22 20:05:09 +00:00
|
|
|
duckdb = [ duckdb duckdb-engine packaging sqlalchemy sqlalchemy-views ];
|
|
|
|
flink = [ ];
|
2022-05-18 14:49:53 +00:00
|
|
|
geospatial = [ geoalchemy2 geopandas shapely ];
|
2023-04-29 16:46:19 +00:00
|
|
|
mysql = [ sqlalchemy pymysql sqlalchemy-views ];
|
2023-08-22 20:05:09 +00:00
|
|
|
oracle = [ sqlalchemy oracledb packaging sqlalchemy-views ];
|
2023-04-29 16:46:19 +00:00
|
|
|
pandas = [ regex ];
|
2023-08-22 20:05:09 +00:00
|
|
|
polars = [ polars ];
|
2023-04-29 16:46:19 +00:00
|
|
|
postgres = [ psycopg2 sqlalchemy sqlalchemy-views ];
|
2023-08-22 20:05:09 +00:00
|
|
|
pyspark = [ pyspark sqlalchemy ];
|
2023-04-29 16:46:19 +00:00
|
|
|
snowflake = [ snowflake-connector-python snowflake-sqlalchemy sqlalchemy-views ];
|
|
|
|
sqlite = [ regex sqlalchemy sqlite sqlalchemy-views ];
|
|
|
|
trino = [ trino-python-client sqlalchemy sqlalchemy-views ];
|
2022-05-18 14:49:53 +00:00
|
|
|
visualization = [ graphviz-nox ];
|
2023-04-29 16:46:19 +00:00
|
|
|
decompiler = [ black ];
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
};
|
2022-01-23 02:10:13 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Productivity-centric Python Big Data Framework";
|
|
|
|
homepage = "https://github.com/ibis-project/ibis";
|
2023-04-29 16:46:19 +00:00
|
|
|
changelog = "https://github.com/ibis-project/ibis/blob/${version}/docs/release_notes.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|