1{ lib
2, buildPythonPackage
3, db-dtypes
4, fetchPypi
5, freezegun
6, google-api-core
7, google-cloud-bigquery-storage
8, google-cloud-core
9, google-cloud-datacatalog
10, google-cloud-storage
11, google-cloud-testutils
12, google-resumable-media
13, grpcio
14, ipython
15, mock
16, pandas
17, proto-plus
18, protobuf
19, psutil
20, pyarrow
21, pytest-xdist
22, pytestCheckHook
23, python-dateutil
24, pythonOlder
25, requests
26, tqdm
27}:
28
29buildPythonPackage rec {
30 pname = "google-cloud-bigquery";
31 version = "3.11.4";
32 format = "setuptools";
33
34 disabled = pythonOlder "3.7";
35
36 src = fetchPypi {
37 inherit pname version;
38 hash = "sha256-aX3xFyQaIoO8u5OyHhC63BTlHJqQgA0qfho+HH2EKXQ=";
39 };
40
41 propagatedBuildInputs = [
42 grpcio
43 google-api-core
44 google-cloud-core
45 google-cloud-bigquery-storage
46 google-resumable-media
47 proto-plus
48 protobuf
49 requests
50 python-dateutil
51 ] ++ google-api-core.optional-dependencies.grpc;
52
53 passthru.optional-dependencies = {
54 bqstorage = [
55 google-cloud-bigquery-storage
56 grpcio
57 pyarrow
58 ];
59 pandas = [
60 db-dtypes
61 pandas
62 pyarrow
63 ];
64 tqdm = [
65 tqdm
66 ];
67 ipython = [
68 ipython
69 ];
70 };
71
72 nativeCheckInputs = [
73 freezegun
74 google-cloud-testutils
75 mock
76 psutil
77 google-cloud-datacatalog
78 google-cloud-storage
79 pytestCheckHook
80 pytest-xdist
81 ] ++ passthru.optional-dependencies.pandas
82 ++ passthru.optional-dependencies.ipython;
83
84 # prevent google directory from shadowing google imports
85 preCheck = ''
86 rm -r google
87 '';
88
89 disabledTests = [
90 # requires credentials
91 "test_bigquery_magic"
92 "TestBigQuery"
93 "test_context_with_no_query_cache_from_context"
94 "test_arrow_extension_types_same_for_storage_and_REST_APIs_894"
95 "test_list_rows_empty_table"
96 "test_list_rows_page_size"
97 "test_list_rows_scalars"
98 "test_list_rows_scalars_extreme"
99 "test_dry_run"
100 "test_session"
101 # Mocking of _ensure_bqstorage_client fails
102 "test_to_arrow_ensure_bqstorage_client_wo_bqstorage"
103 # requires network
104 "test_dbapi_create_view"
105 "test_list_rows_nullable_scalars_dtypes"
106 "test_parameterized_types_round_trip"
107 "test_structs"
108 "test_table_snapshots"
109 "test__initiate_resumable_upload"
110 "test__initiate_resumable_upload_mtls"
111 "test__initiate_resumable_upload_with_retry"
112 "test_table_clones"
113 "test_context_with_default_connection"
114 "test_context_with_custom_connection"
115 ];
116
117 disabledTestPaths = [
118 # Tests require credentials
119 "tests/system/test_query.py"
120 "tests/system/test_job_retry.py"
121 "tests/system/test_pandas.py"
122 ];
123
124 pythonImportsCheck = [
125 "google.cloud.bigquery"
126 "google.cloud.bigquery_v2"
127 ];
128
129 meta = with lib; {
130 # Not compatible with pyarrow13 yet.
131 broken = true;
132 description = "Google BigQuery API client library";
133 homepage = "https://github.com/googleapis/python-bigquery";
134 changelog = "https://github.com/googleapis/python-bigquery/blob/v${version}/CHANGELOG.md";
135 license = licenses.asl20;
136 maintainers = with maintainers; [ ];
137 };
138}