Skip to content

Commit e00baa0

Browse files
authored
Merge pull request #1653 from dlt-hub/devel
master merge for `0.5.2` release
2 parents 75410e6 + 8cddfcf commit e00baa0

File tree

176 files changed

+4988
-1385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+4988
-1385
lines changed

.github/weaviate-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ services:
1111
image: semitechnologies/weaviate:1.21.1
1212
ports:
1313
- 8080:8080
14-
volumes:
15-
- weaviate_data
1614
restart: on-failure:0
1715
environment:
1816
QUERY_DEFAULTS_LIMIT: 25

.github/workflows/test_destination_clickhouse.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: test | clickhouse
32

43
on:
@@ -8,7 +7,7 @@ on:
87
- devel
98
workflow_dispatch:
109
schedule:
11-
- cron: '0 2 * * *'
10+
- cron: '0 2 * * *'
1211

1312
concurrency:
1413
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -20,7 +19,7 @@ env:
2019
DLT_SECRETS_TOML: ${{ secrets.DLT_SECRETS_TOML }}
2120

2221
ACTIVE_DESTINATIONS: "[\"clickhouse\"]"
23-
ALL_FILESYSTEM_DRIVERS: "[\"memory\"]"
22+
ALL_FILESYSTEM_DRIVERS: "[\"memory\", \"file\"]"
2423

2524
jobs:
2625
get_docs_changes:
@@ -67,12 +66,51 @@ jobs:
6766
- name: create secrets.toml
6867
run: pwd && echo "$DLT_SECRETS_TOML" > tests/.dlt/secrets.toml
6968

69+
# OSS ClickHouse
70+
- run: |
71+
docker compose -f "tests/load/clickhouse/clickhouse-compose.yml" up -d
72+
echo "Waiting for ClickHouse to be healthy..."
73+
timeout 30s bash -c 'until docker compose -f "tests/load/clickhouse/clickhouse-compose.yml" ps | grep -q "healthy"; do sleep 1; done'
74+
echo "ClickHouse is up and running"
75+
name: Start ClickHouse OSS
76+
77+
78+
- run: poetry run pytest tests/load -m "essential"
79+
name: Run essential tests Linux (ClickHouse OSS)
80+
if: ${{ ! (contains(github.event.pull_request.labels.*.name, 'ci full') || github.event_name == 'schedule')}}
81+
env:
82+
DESTINATION__CLICKHOUSE__CREDENTIALS__HOST: localhost
83+
DESTINATION__CLICKHOUSE__CREDENTIALS__DATABASE: dlt_data
84+
DESTINATION__CLICKHOUSE__CREDENTIALS__USERNAME: loader
85+
DESTINATION__CLICKHOUSE__CREDENTIALS__PASSWORD: loader
86+
DESTINATION__CLICKHOUSE__CREDENTIALS__PORT: 9000
87+
DESTINATION__CLICKHOUSE__CREDENTIALS__HTTP_PORT: 8123
88+
DESTINATION__CLICKHOUSE__CREDENTIALS__SECURE: 0
89+
90+
- run: poetry run pytest tests/load
91+
name: Run all tests Linux (ClickHouse OSS)
92+
if: ${{ contains(github.event.pull_request.labels.*.name, 'ci full') || github.event_name == 'schedule'}}
93+
env:
94+
DESTINATION__CLICKHOUSE__CREDENTIALS__HOST: localhost
95+
DESTINATION__CLICKHOUSE__CREDENTIALS__DATABASE: dlt_data
96+
DESTINATION__CLICKHOUSE__CREDENTIALS__USERNAME: loader
97+
DESTINATION__CLICKHOUSE__CREDENTIALS__PASSWORD: loader
98+
DESTINATION__CLICKHOUSE__CREDENTIALS__PORT: 9000
99+
DESTINATION__CLICKHOUSE__CREDENTIALS__HTTP_PORT: 8123
100+
DESTINATION__CLICKHOUSE__CREDENTIALS__SECURE: 0
101+
102+
- name: Stop ClickHouse OSS
103+
if: always()
104+
run: docker compose -f "tests/load/clickhouse/clickhouse-compose.yml" down -v
105+
106+
# ClickHouse Cloud
70107
- run: |
71108
poetry run pytest tests/load -m "essential"
72-
name: Run essential tests Linux
109+
name: Run essential tests Linux (ClickHouse Cloud)
73110
if: ${{ ! (contains(github.event.pull_request.labels.*.name, 'ci full') || github.event_name == 'schedule')}}
74111
75112
- run: |
76113
poetry run pytest tests/load
77-
name: Run all tests Linux
114+
name: Run all tests Linux (ClickHouse Cloud)
78115
if: ${{ contains(github.event.pull_request.labels.*.name, 'ci full') || github.event_name == 'schedule'}}
116+

.github/workflows/test_destination_dremio.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/checkout@master
4444

4545
- name: Start dremio
46-
run: docker-compose -f "tests/load/dremio/docker-compose.yml" up -d
46+
run: docker compose -f "tests/load/dremio/docker-compose.yml" up -d
4747

4848
- name: Setup Python
4949
uses: actions/setup-python@v4
@@ -87,4 +87,4 @@ jobs:
8787
8888
- name: Stop dremio
8989
if: always()
90-
run: docker-compose -f "tests/load/dremio/docker-compose.yml" down -v
90+
run: docker compose -f "tests/load/dremio/docker-compose.yml" down -v

.github/workflows/test_doc_snippets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
uses: actions/checkout@master
6161

6262
- name: Start weaviate
63-
run: docker-compose -f ".github/weaviate-compose.yml" up -d
63+
run: docker compose -f ".github/weaviate-compose.yml" up -d
6464

6565
- name: Setup Python
6666
uses: actions/setup-python@v4

.github/workflows/test_local_destinations.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
uses: actions/checkout@master
7474

7575
- name: Start weaviate
76-
run: docker-compose -f ".github/weaviate-compose.yml" up -d
76+
run: docker compose -f ".github/weaviate-compose.yml" up -d
7777

7878
- name: Setup Python
7979
uses: actions/setup-python@v4
@@ -109,4 +109,4 @@ jobs:
109109

110110
- name: Stop weaviate
111111
if: always()
112-
run: docker-compose -f ".github/weaviate-compose.yml" down -v
112+
run: docker compose -f ".github/weaviate-compose.yml" down -v
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
name: tests marked as needspyarrow17
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- master
8+
- devel
9+
workflow_dispatch:
10+
schedule:
11+
- cron: '0 2 * * *'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
19+
DLT_SECRETS_TOML: ${{ secrets.DLT_SECRETS_TOML }}
20+
21+
RUNTIME__SENTRY_DSN: https://[email protected]/4504819859914752
22+
RUNTIME__LOG_LEVEL: ERROR
23+
RUNTIME__DLTHUB_TELEMETRY_ENDPOINT: ${{ secrets.RUNTIME__DLTHUB_TELEMETRY_ENDPOINT }}
24+
25+
ACTIVE_DESTINATIONS: "[\"filesystem\"]"
26+
27+
jobs:
28+
get_docs_changes:
29+
name: docs changes
30+
uses: ./.github/workflows/get_docs_changes.yml
31+
if: ${{ !github.event.pull_request.head.repo.fork || contains(github.event.pull_request.labels.*.name, 'ci from fork')}}
32+
33+
run_pyarrow17:
34+
name: needspyarrow17 tests
35+
needs: get_docs_changes
36+
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
37+
defaults:
38+
run:
39+
shell: bash
40+
runs-on: "ubuntu-latest"
41+
42+
steps:
43+
44+
- name: Check out
45+
uses: actions/checkout@master
46+
47+
- name: Setup Python
48+
uses: actions/setup-python@v4
49+
with:
50+
python-version: "3.10.x"
51+
52+
- name: Install Poetry
53+
uses: snok/[email protected]
54+
with:
55+
virtualenvs-create: true
56+
virtualenvs-in-project: true
57+
installer-parallel: true
58+
59+
- name: Load cached venv
60+
id: cached-poetry-dependencies
61+
uses: actions/cache@v3
62+
with:
63+
path: .venv
64+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-pyarrow17
65+
66+
- name: Install dependencies
67+
run: poetry install --no-interaction --with sentry-sdk --with pipeline -E deltalake -E gs -E s3 -E az
68+
69+
- name: Upgrade pyarrow
70+
run: poetry run pip install pyarrow==17.0.0
71+
72+
- name: create secrets.toml
73+
run: pwd && echo "$DLT_SECRETS_TOML" > tests/.dlt/secrets.toml
74+
75+
- run: |
76+
poetry run pytest tests/libs tests/load -m needspyarrow17
77+
name: Run needspyarrow17 tests Linux

deploy/dlt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN apk update &&\
3131
# add build labels and envs
3232
ARG COMMIT_SHA=""
3333
ARG IMAGE_VERSION=""
34-
LABEL commit_sha = ${COMMIT_SHA}
34+
LABEL commit_sha=${COMMIT_SHA}
3535
LABEL version=${IMAGE_VERSION}
3636
ENV COMMIT_SHA=${COMMIT_SHA}
3737
ENV IMAGE_VERSION=${IMAGE_VERSION}

deploy/dlt/Dockerfile.airflow

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ WORKDIR /tmp/pydlt
1414
# add build labels and envs
1515
ARG COMMIT_SHA=""
1616
ARG IMAGE_VERSION=""
17-
LABEL commit_sha = ${COMMIT_SHA}
17+
LABEL commit_sha=${COMMIT_SHA}
1818
LABEL version=${IMAGE_VERSION}
1919
ENV COMMIT_SHA=${COMMIT_SHA}
2020
ENV IMAGE_VERSION=${IMAGE_VERSION}

dlt/cli/init_command.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import ast
33
import shutil
4+
import tomlkit
45
from types import ModuleType
56
from typing import Dict, List, Sequence, Tuple
67
from importlib.metadata import version as pkg_version
@@ -488,16 +489,19 @@ def init_command(
488489

489490
# generate tomls with comments
490491
secrets_prov = SecretsTomlProvider()
491-
# print(secrets_prov._toml)
492-
write_values(secrets_prov._toml, required_secrets.values(), overwrite_existing=False)
492+
secrets_toml = tomlkit.document()
493+
write_values(secrets_toml, required_secrets.values(), overwrite_existing=False)
494+
secrets_prov._config_doc = secrets_toml
495+
493496
config_prov = ConfigTomlProvider()
494-
write_values(config_prov._toml, required_config.values(), overwrite_existing=False)
497+
config_toml = tomlkit.document()
498+
write_values(config_toml, required_config.values(), overwrite_existing=False)
499+
config_prov._config_doc = config_toml
500+
495501
# write toml files
496502
secrets_prov.write_toml()
497503
config_prov.write_toml()
498504

499-
# telemetry_status_command()
500-
501505
# if there's no dependency system write the requirements file
502506
if dependency_system is None:
503507
requirements_txt = "\n".join(source_files.requirements.compiled())

dlt/cli/telemetry_command.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
2+
import tomlkit
23

3-
from dlt.common.configuration import resolve_configuration
44
from dlt.common.configuration.container import Container
55
from dlt.common.configuration.providers.toml import ConfigTomlProvider
66
from dlt.common.configuration.specs import RunConfiguration
@@ -29,15 +29,21 @@ def change_telemetry_status_command(enabled: bool) -> None:
2929
]
3030
# write local config
3131
config = ConfigTomlProvider(add_global_config=False)
32+
config_toml = tomlkit.document()
3233
if not config.is_empty:
33-
write_values(config._toml, telemetry_value, overwrite_existing=True)
34+
write_values(config_toml, telemetry_value, overwrite_existing=True)
35+
config._config_doc = config_toml
3436
config.write_toml()
37+
3538
# write global config
3639
global_path = ConfigTomlProvider.global_config_path()
3740
os.makedirs(global_path, exist_ok=True)
3841
config = ConfigTomlProvider(project_dir=global_path, add_global_config=False)
39-
write_values(config._toml, telemetry_value, overwrite_existing=True)
42+
config_toml = tomlkit.document()
43+
write_values(config_toml, telemetry_value, overwrite_existing=True)
44+
config._config_doc = config_toml
4045
config.write_toml()
46+
4147
if enabled:
4248
fmt.echo("Telemetry switched %s" % fmt.bold("ON"))
4349
else:

0 commit comments

Comments
 (0)