diff --git a/cratedb_toolkit/util/database.py b/cratedb_toolkit/util/database.py index 7206628..e5d435d 100644 --- a/cratedb_toolkit/util/database.py +++ b/cratedb_toolkit/util/database.py @@ -1,6 +1,7 @@ # Copyright (c) 2023, Crate.io Inc. # Distributed under the terms of the AGPLv3 license, see LICENSE. import io +import os import typing as t from pathlib import Path @@ -227,8 +228,7 @@ def import_csv_dask( from crate.client.sqlalchemy.support import insert_bulk # Set a few defaults. - # TODO: Use amount of CPU cores instead? - npartitions = npartitions or 4 + npartitions = npartitions or os.cpu_count() if progress: from dask.diagnostics import ProgressBar