Skip to content

Commit 5b6edb9

Browse files
committed
make the pyarrow.dataset import optional
1 parent 824fae7 commit 5b6edb9

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

scripts/cache_data.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"pyarrow.decimal32",
2121
"pyarrow.decimal64",
2222
"pyarrow.decimal128"
23-
]
23+
],
24+
"required": false
2425
},
2526
"pyarrow.dataset": {
2627
"type": "module",
@@ -29,7 +30,8 @@
2930
"children": [
3031
"pyarrow.dataset.Scanner",
3132
"pyarrow.dataset.Dataset"
32-
]
33+
],
34+
"required": false
3335
},
3436
"pyarrow.dataset.Scanner": {
3537
"type": "attribute",

src/duckdb_py/include/duckdb_python/import_cache/modules/pyarrow_module.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ struct PyarrowDatasetCacheItem : public PythonImportCacheItem {
4646

4747
PythonImportCacheItem Scanner;
4848
PythonImportCacheItem Dataset;
49+
50+
protected:
51+
bool IsRequired() const override final {
52+
return false;
53+
}
4954
};
5055

5156
struct PyarrowCacheItem : public PythonImportCacheItem {
@@ -80,6 +85,11 @@ struct PyarrowCacheItem : public PythonImportCacheItem {
8085
PythonImportCacheItem decimal32;
8186
PythonImportCacheItem decimal64;
8287
PythonImportCacheItem decimal128;
88+
89+
protected:
90+
bool IsRequired() const override final {
91+
return false;
92+
}
8393
};
8494

8595
} // namespace duckdb

0 commit comments

Comments
 (0)