Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move rest_api, sql_database and filesystem sources to dlt core #1728

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
beab83f
copies rest_api source code and test suite, adjusts imports
willi-mueller Aug 14, 2024
16ba857
integrates rest_client/conftest.pi into rest_api/conftest.py. Fixes i…
willi-mueller Aug 16, 2024
c0c7bed
integrates POST search test
willi-mueller Aug 19, 2024
d7e1ef0
do no longer skip test with typed dict config
willi-mueller Aug 19, 2024
ff97717
reuses tests/sources/helpers/rest_client/conftest.py in tests/sources…
willi-mueller Aug 19, 2024
d252113
checks off TODO
willi-mueller Aug 19, 2024
5c58a59
formats rest_api code according to dlt-core rules
willi-mueller Aug 19, 2024
f1122ed
fixes typing errors and graphlib import error
willi-mueller Aug 19, 2024
042bc96
moves latest changes from rest_api into core (687e7ddab3a95fa62158474…
willi-mueller Aug 22, 2024
ed176ec
modularizes rest_api test suite
willi-mueller Aug 22, 2024
0f79989
formats code and imports
willi-mueller Aug 22, 2024
c580c46
updates signature of Paginator.update_state()
willi-mueller Aug 22, 2024
d623932
moves source test suite after duckdb is installed
willi-mueller Aug 22, 2024
854256f
end-to-end test rest_api_source on all destinations. Removes redundan…
willi-mueller Aug 23, 2024
41af3dd
adds example rest_api_pipeline.py, corrects sample rest_api_pipeline …
willi-mueller Aug 23, 2024
a6ddde3
loads latest 30 days of issues instead of fixed date
willi-mueller Aug 23, 2024
b20eddf
refactors types
willi-mueller Aug 27, 2024
64a8b73
tests example rest_api pipelines, adds filesystem configs to load tests
willi-mueller Aug 28, 2024
807b1b6
fix inheritance of incremental args, make typed_dict detection work w…
sh-rp Aug 28, 2024
ce87a4c
type incremental cursor_path as str
willi-mueller Aug 28, 2024
bfa3ffb
refactors intersection of TResourceHints and ResourceBase into TResou…
willi-mueller Aug 28, 2024
aa9764d
uses str instead of generic TCursorValue
willi-mueller Aug 28, 2024
3f499df
configures github access token for CI
willi-mueller Aug 28, 2024
7c9bd0d
copies sql source and tests
willi-mueller Aug 26, 2024
7f2c596
adjusts import paths
willi-mueller Aug 26, 2024
67e86d5
workaround for UUID type missing in sqlalchemy < 2.0
willi-mueller Aug 26, 2024
2033a12
extracts load tests to tests/load. Adds necessary test utility functions
willi-mueller Aug 26, 2024
1f78430
formats code
willi-mueller Aug 26, 2024
09d1414
corrects example postgres credentials for the test suite
willi-mueller Aug 27, 2024
aad8738
formats imports, removes duplicate definition
willi-mueller Aug 27, 2024
db37a0d
conditionally skips test for range type detection
willi-mueller Aug 30, 2024
8d2153a
fixes side effects of tests modifying os.environ.
willi-mueller Aug 30, 2024
d549423
fixes lint errors
willi-mueller Aug 30, 2024
22d6e92
moves tests to right places, runs on all destinations where applicable
rudolfix Aug 23, 2024
db9b176
post rebase fixes and formatting
sh-rp Sep 3, 2024
d79036c
first simple version of init command that can use core sources
sh-rp Aug 28, 2024
cd1d658
update tests for core sources
sh-rp Aug 28, 2024
0a426ec
improve tests a bit more
sh-rp Aug 28, 2024
6728350
move init / generic source to core
sh-rp Aug 28, 2024
b9dd3d5
detect explicit repo url in init command
sh-rp Aug 30, 2024
7fa2d54
update output and clean up structure in init command a bit
sh-rp Sep 2, 2024
0d8a85a
fix tests
sh-rp Sep 2, 2024
b7caaa2
add option for omitting core sources and reverting to the old behavior
sh-rp Sep 2, 2024
f30fff5
add core sources to the dlt init -l list
sh-rp Sep 2, 2024
c3a8b77
add init template files to build
sh-rp Sep 2, 2024
981926a
remove one unneded file
sh-rp Sep 2, 2024
6772d8e
revert common tests file
sh-rp Sep 3, 2024
74a3bf4
move sources tests to dedicated file
sh-rp Sep 3, 2024
47e1933
remove destination tests for now, revert later
sh-rp Sep 3, 2024
1ac5bf0
upgrade sqlalchemy for local source tests
sh-rp Sep 3, 2024
c497a2b
create sql_database extra
sh-rp Sep 3, 2024
a162396
fix bug in transform
sh-rp Sep 3, 2024
60039e5
set up timezone fixtures properly, still does not work right
sh-rp Sep 3, 2024
6a49f81
fallback to timezone on duckdb with timestamp
sh-rp Sep 3, 2024
2e127a1
separate common from load tests properly
sh-rp Sep 4, 2024
1b7f8d7
update duckdb timezone test
sh-rp Sep 4, 2024
31fa166
add sql_alchemy dependency to last part of common tests
sh-rp Sep 4, 2024
a6ee746
updates imports
sh-rp Sep 4, 2024
be0a6c7
add sql_database_pipeline file, update dlt init commands, add basic t…
sh-rp Sep 4, 2024
dce37a3
only import sqlalchemy in tests if present
sh-rp Sep 4, 2024
1b8e746
fix linter errors
sh-rp Sep 4, 2024
643048c
bump connectorx for python 3.12 support
sh-rp Sep 4, 2024
fbd6ee5
move sql_alchemy shims to shims file and use the original file for th…
sh-rp Sep 4, 2024
5bdcf3a
Fix linter errors (reverts back to wilis version from a few commits ago)
sh-rp Sep 4, 2024
f538059
exclude connectorx from python 3.8
sh-rp Sep 4, 2024
fc21cac
make rest api example pipeline also work without a token
sh-rp Sep 4, 2024
71b4a4e
remove secrets from local sources tests
sh-rp Sep 4, 2024
85b0375
change test setup to work with both sqlalchemy versions
sh-rp Sep 4, 2024
e449ad2
adds secrets to a part of common tests
sh-rp Sep 4, 2024
a365f62
make sql database pipeline tests succeed on both sqlalchemy versions
sh-rp Sep 4, 2024
d014667
add excel dependenices to common tests
sh-rp Sep 4, 2024
451b9e2
fix bug in schema inference of sql_alchemy backed sources
sh-rp Sep 4, 2024
2694624
fix tests running for sql alchemy 1.4
sh-rp Sep 4, 2024
d6b70bc
add concept of single file templates in the core
sh-rp Sep 5, 2024
80d778e
update tests and fix some
sh-rp Sep 5, 2024
38aeb05
add some example pipelines
sh-rp Sep 5, 2024
87d6b81
fixes some issues
sh-rp Sep 5, 2024
5ac5939
sort source names
sh-rp Sep 5, 2024
ae665ba
fix unsupported columns
sh-rp Sep 5, 2024
3427cc8
fix all sql database tests for sqlalchemy 2.0
sh-rp Sep 5, 2024
7264799
fix some tests for sqlalchemy 1.4
sh-rp Sep 5, 2024
c3ef897
deselect connectorx incremental tests on sqlalchemy 1.4
sh-rp Sep 5, 2024
c02e87b
fixes some more tests
sh-rp Sep 5, 2024
55c135d
some cleanup
sh-rp Sep 5, 2024
94e69f1
fix bug in init script
sh-rp Sep 5, 2024
32bcc89
Revert "remove destination tests for now, revert later"
sh-rp Sep 5, 2024
5e32407
exclude sources load tests from destination workflows
sh-rp Sep 5, 2024
3e7b0e0
fix openpyxl install
sh-rp Sep 5, 2024
caaa8e5
disable requests tests for now
sh-rp Sep 5, 2024
2388223
fix commen tests
sh-rp Sep 6, 2024
5ef6672
add dataframe example pipeline
sh-rp Sep 6, 2024
0830f56
add intro examples
sh-rp Sep 6, 2024
26832d8
update cleaning scripts for athena and redshift
sh-rp Sep 6, 2024
dc7406c
make timezone tests slightly more strict
sh-rp Sep 6, 2024
a0d90ac
reorders sql_database import to get user friendly dependency error
rudolfix Sep 8, 2024
ea1ce2c
Merge branch 'devel' into feat/1484-integrate-rest-api-generic-source…
rudolfix Sep 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dlt/common/libs/sql_alchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
from sqlalchemy.sql import sqltypes, Select
from sqlalchemy.sql.sqltypes import TypeEngine
from sqlalchemy.exc import CompileError
import sqlalchemy as sa
except ModuleNotFoundError:
raise MissingDependencyException(
"dlt sql_database helpers ",
[f"{version.DLT_PKG_NAME}[sql_database]"],
"Install the sql_database helpers for loading from sql_database sources.",
)

# TODO: maybe use sa.__version__?
IS_SQL_ALCHEMY_20 = hasattr(sa, "Double")
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def test_type_adapter_callback(
def conversion_callback(t):
if isinstance(t, sa.JSON):
return sa.Text
elif hasattr(sa, "Double") and isinstance(t, sa.Double): # type: ignore[attr-defined]
elif hasattr(sa, "Double") and isinstance(t, sa.Double):
return sa.BIGINT
return t

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
default_test_callback,
)
from tests.load.sources.sql_database.sql_source import SQLAlchemySourceDB
from dlt.common.libs.sql_alchemy import IS_SQL_ALCHEMY_20
except MissingDependencyException:
pytest.skip("Tests require sql alchemy", allow_module_level=True)

Expand Down Expand Up @@ -155,6 +156,9 @@ def test_load_sql_table_incremental(
"""
os.environ["SOURCES__SQL_DATABASE__CHAT_MESSAGE__INCREMENTAL__CURSOR_PATH"] = "updated_at"

if not IS_SQL_ALCHEMY_20 and backend == "connectorx":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can probably get these to work again on sqlalchemy 1.4 if we don't use an date at but an int column for incremental

pytest.skip("Test will not run on sqlalchemy 1.4 with connectorx")

pipeline = destination_config.setup_pipeline(request.node.name, dev_mode=True)
tables = ["chat_message"]

Expand Down Expand Up @@ -280,6 +284,9 @@ def test_load_sql_table_resource_incremental(
backend: TableBackend,
request: Any,
) -> None:
if not IS_SQL_ALCHEMY_20 and backend == "connectorx":
pytest.skip("Test will not run on sqlalchemy 1.4 with connectorx")

@dlt.source
def sql_table_source() -> List[DltResource]:
return [
Expand Down Expand Up @@ -315,6 +322,9 @@ def test_load_sql_table_resource_incremental_initial_value(
backend: TableBackend,
request: Any,
) -> None:
if not IS_SQL_ALCHEMY_20 and backend == "connectorx":
pytest.skip("Test will not run on sqlalchemy 1.4 with connectorx")

@dlt.source
def sql_table_source() -> List[DltResource]:
return [
Expand Down
Loading