-
Notifications
You must be signed in to change notification settings - Fork 199
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
Synapse destination #900
Merged
Merged
Synapse destination #900
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7bc2163
Synapse destination initial commit
05b0530
make var type consistent
dc7619a
simplify client init logic
702dd28
add support for table index type configuration
db73162
add load concurrency handling and warning
5891a9a
Merge branch 'devel' of https://github.com/dlt-hub/dlt into 832-synap…
75be2ce
rewrite naive code to prevent IndexError
014543a
add support for staged Parquet loading
7868ca6
made table index type logic Synapse specific through destination adapter
b4cdd36
moved test function into tests folder and renamed test file
97f66e2
ensure test data gets removed
90685e7
add pyarrow to synapse dependencies for parquet loading
494e45b
added user docs for synapse destination
e8c6b1d
refactor dbt test skipping to prevent unnecessary venv creation
e1e9bb3
replace CTAS with CREATE TABLE to eliminate concurrency issues
99a0718
change test config type to reduce unnecessary tests
6d14d57
remove trailing whitespace
b87dd1b
refine staging table indexing
1c817bd
use generic statement to prevent repeating info
2dd979e
remove outdated documentation
da5cdac
add synapse destination to sidebar
d7d9e35
add support for additional table hints
e931ffb
Merge branch 'devel' into 832-synapse-destination
jorritsandbrink bab216d
correct content-hash after merge conflict resolution
c3efe33
only remove hint if it is None, not if it is empty
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: test synapse | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- devel | ||
workflow_dispatch: | ||
|
||
env: | ||
DLT_SECRETS_TOML: ${{ secrets.DLT_SECRETS_TOML }} | ||
|
||
RUNTIME__SENTRY_DSN: https://cf6086f7d263462088b9fb9f9947caee@o4505514867163136.ingest.sentry.io/4505516212682752 | ||
RUNTIME__LOG_LEVEL: ERROR | ||
|
||
ACTIVE_DESTINATIONS: "[\"synapse\"]" | ||
ALL_FILESYSTEM_DRIVERS: "[\"memory\"]" | ||
|
||
jobs: | ||
get_docs_changes: | ||
uses: ./.github/workflows/get_docs_changes.yml | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
|
||
run_loader: | ||
name: Tests Synapse loader | ||
needs: get_docs_changes | ||
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
defaults: | ||
run: | ||
shell: bash | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
|
||
- name: Check out | ||
uses: actions/checkout@master | ||
|
||
- name: Install ODBC driver for SQL Server | ||
run: | | ||
sudo ACCEPT_EULA=Y apt-get install --yes msodbcsql18 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10.x" | ||
|
||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-gcp | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction -E synapse -E parquet --with sentry-sdk --with pipeline | ||
|
||
- name: create secrets.toml | ||
run: pwd && echo "$DLT_SECRETS_TOML" > tests/.dlt/secrets.toml | ||
|
||
- run: | | ||
poetry run pytest tests/load | ||
if: runner.os != 'Windows' | ||
name: Run tests Linux/MAC | ||
- run: | | ||
poetry run pytest tests/load | ||
if: runner.os == 'Windows' | ||
name: Run tests Windows | ||
shell: cmd | ||
|
||
matrix_job_required_check: | ||
name: Synapse loader tests | ||
needs: run_loader | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Check matrix job results | ||
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | ||
run: | | ||
echo "One or more matrix job tests failed or were cancelled. You may need to re-run them." && exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rudolfix we can switch between 2 index types (https://learn.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/sql-data-warehouse-tables-index) and we have a new table hint here. I am wondering if we can re-use table_format or wether this needs to be a separate hint. I am not quite sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was to keep
table_format
limited to table formats such as Iceberg, Delta, and Hudi. Then within a certain table format, one can still choose between different table indexing types supported by that table format. Look at Hudi for example, which supports a bunch of different indexing types.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like a case for destination adapter. it sets per-destination options on a resource using x- hints. please look into:
https://github.com/dlt-hub/dlt/blob/devel/dlt/destinations/adapters.py
and bigquery adapter that @Pipboyguy is doing: #855
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rewrote the code to make use of a destination adapter. Looked at
qdrant_adapter
andweaviate_adapter
for inspiration. Thesynapse_adapter
is slightly different because it works with a table hint, not column hints likeqdrant
andweaviate
. Sincex-table-index-type
is not defined onTResourceHints
, I have to ignore mypy'stypeddict-unknown-key
errors. Is this what you had in mind @rudolfix?