fixes arrow import in sql_database (#3411)

* fixes pyarrow import in sql_database

* bumps to 1.19.1

* linter fix

* fixes common workflow
This commit is contained in:
rudolfix
2025-12-02 18:33:03 +01:00
committed by GitHub
parent e5977c1ace
commit dd38c80fb4
5 changed files with 16 additions and 6 deletions

View File

@@ -104,13 +104,20 @@ jobs:
- name: Run common tests with minimum dependencies
run: |
pytest tests/common tests/normalize tests/reflection tests/plugins tests/load/test_dummy_client.py tests/extract/test_extract.py tests/extract/test_sources.py tests/pipeline/test_pipeline_state.py ${{ matrix.pytest_args }}
- name: Install min dependencies to import core source
run: uv sync ${{ matrix.uv_sync_args }} --group sentry-sdk --extra sql_database
- name: Run min dependencies source tests
run: |
pytest tests/sources/test_minimal_dependencies.py ${{ matrix.pytest_args }}
- name: Install duckdb dependencies
run: uv sync ${{ matrix.uv_sync_args }} --extra duckdb --group sentry-sdk
- name: Run pipeline smoke tests with minimum deps
run: |
pytest tests/pipeline/test_pipeline.py tests/pipeline/test_import_export_schema.py ${{ matrix.pytest_args }}
pytest tests/pipeline/test_pipeline.py tests/pipeline/test_import_export_schema.py tests/sources/rest_api/integration/ ${{ matrix.pytest_args }}
- name: Install pyarrow
run: uv sync ${{ matrix.uv_sync_args }} --extra duckdb --extra cli --extra parquet --group sentry-sdk

View File

@@ -22,7 +22,6 @@ from dlt.common.configuration.specs import (
configspec,
)
from dlt.common.exceptions import DltException, MissingDependencyException
from dlt.common.libs.pyarrow import cast_date64_columns_to_timestamp
from dlt.common.schema import TTableSchemaColumns
from dlt.common.schema.typing import TWriteDispositionDict
from dlt.common.typing import TColumnNames, TDataItem, TSortOrder
@@ -223,13 +222,14 @@ class TableLoader:
def _load_rows_connectorx(
self, query: SelectClause, backend_kwargs: Dict[str, Any]
) -> Iterator[TDataItem]:
import pyarrow as pa
try:
import connectorx as cx
except ImportError:
raise MissingDependencyException("Connector X table backend", ["connectorx"])
import pyarrow as pa
from dlt.common.libs.pyarrow import cast_date64_columns_to_timestamp
# default settings
backend_kwargs = {
"protocol": "binary",

View File

@@ -1,6 +1,6 @@
[project]
name = "dlt"
version = "1.19.0"
version = "1.19.1"
description = "dlt is an open-source python-first scalable data loading library that does not require any backend to run."
authors = [{ name = "dltHub Inc.", email = "services@dlthub.com" }]
requires-python = ">=3.9.2, <3.15"

View File

@@ -0,0 +1,3 @@
def test_import_core_sources() -> None:
# import all core sources with minimum deps
from dlt.sources import filesystem, sql_database, rest_api

2
uv.lock generated
View File

@@ -2007,7 +2007,7 @@ wheels = [
[[package]]
name = "dlt"
version = "1.19.0"
version = "1.19.1"
source = { editable = "." }
dependencies = [
{ name = "click" },