2022-09-22 12:36:57 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-dateutil
|
|
|
|
, duckdb
|
2023-02-16 17:41:37 +00:00
|
|
|
, pyspark
|
2022-09-22 12:36:57 +00:00
|
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sqlglot";
|
2023-02-16 17:41:37 +00:00
|
|
|
version = "10.5.2";
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "sqlglot";
|
|
|
|
owner = "tobymao";
|
|
|
|
rev = "v${version}";
|
2023-02-16 17:41:37 +00:00
|
|
|
hash = "sha256-ZFc2aOhCTRFlrzgnYDSdIZxRqKZ8FvkYSZRU0OMHI34=";
|
2022-09-22 12:36:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ python-dateutil ];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook duckdb pyspark ];
|
|
|
|
|
|
|
|
# these integration tests assume a running Spark instance
|
|
|
|
disabledTestPaths = [ "tests/dataframe/integration" ];
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "sqlglot" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A no dependency Python SQL parser, transpiler, and optimizer";
|
|
|
|
homepage = "https://github.com/tobymao/sqlglot";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
|
|
};
|
|
|
|
}
|