ingestr 0.10.0rc4__tar.gz → 0.10.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ingestr might be problematic. Click here for more details.
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/.gitignore +1 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/PKG-INFO +1 -1
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/main.py +35 -6
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/adjust/__init__.py +1 -1
- ingestr-0.10.1/ingestr/src/filters.py +19 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/sources.py +15 -6
- ingestr-0.10.1/ingestr/src/version.py +1 -0
- ingestr-0.10.0rc4/ingestr/src/filters.py +0 -7
- ingestr-0.10.0rc4/ingestr/src/version.py +0 -1
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/.dockerignore +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/.github/workflows/deploy-docs.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/.github/workflows/tests.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/.python-version +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/.vale.ini +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/Dockerfile +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/LICENSE.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/Makefile +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/README.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/.vitepress/config.mjs +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/.vitepress/theme/custom.css +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/.vitepress/theme/index.js +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/commands/example-uris.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/commands/ingest.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/getting-started/core-concepts.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/getting-started/incremental-loading.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/getting-started/quickstart.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/getting-started/telemetry.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/index.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/adjust.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/airtable.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/appsflyer.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/bigquery.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/chess.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/csv.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/databricks.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/duckdb.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/facebook-ads.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/gorgias.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/gsheets.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/hubspot.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/kafka.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/klaviyo.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/mongodb.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/mssql.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/mysql.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/notion.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/oracle.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/postgres.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/redshift.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/s3.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/sap-hana.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/shopify.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/slack.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/snowflake.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/sqlite.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/stripe.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/docs/supported-sources/zendesk.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/.gitignore +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/adjust/adjust_helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/airtable/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/appsflyer/_init_.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/appsflyer/client.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/arrow/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/chess/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/chess/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/chess/settings.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/destinations.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/facebook_ads/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/facebook_ads/exceptions.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/facebook_ads/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/facebook_ads/settings.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/factory.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/filesystem/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/filesystem/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/filesystem/readers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/google_sheets/README.md +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/google_sheets/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/google_sheets/helpers/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/google_sheets/helpers/api_calls.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/google_sheets/helpers/data_processing.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/gorgias/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/gorgias/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/hubspot/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/hubspot/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/hubspot/settings.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/kafka/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/kafka/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/klaviyo/_init_.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/klaviyo/client.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/klaviyo/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/mongodb/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/mongodb/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/notion/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/notion/helpers/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/notion/helpers/client.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/notion/helpers/database.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/notion/settings.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/shopify/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/shopify/exceptions.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/shopify/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/shopify/settings.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/slack/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/slack/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/slack/settings.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/stripe_analytics/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/stripe_analytics/helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/stripe_analytics/settings.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/table_definition.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/telemetry/event.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/testdata/fakebqcredentials.json +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/zendesk/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/zendesk/helpers/__init__.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/zendesk/helpers/api_helpers.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/zendesk/helpers/credentials.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/zendesk/helpers/talk_api.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/src/zendesk/settings.py +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/testdata/.gitignore +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/testdata/create_replace.csv +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/testdata/delete_insert_expected.csv +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/testdata/delete_insert_part1.csv +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/testdata/delete_insert_part2.csv +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/testdata/merge_expected.csv +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/testdata/merge_part1.csv +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/ingestr/testdata/merge_part2.csv +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/package-lock.json +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/package.json +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/pyproject.toml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/requirements-dev.txt +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/requirements.txt +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/resources/demo.gif +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/resources/demo.tape +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/resources/ingestr.svg +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/AMPM.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Acronyms.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Colons.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Contractions.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/DateFormat.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Ellipses.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/EmDash.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Exclamation.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/FirstPerson.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Gender.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/GenderBias.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/HeadingPunctuation.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Headings.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Latin.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/LyHyphens.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/OptionalPlurals.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Ordinal.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/OxfordComma.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Parens.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Passive.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Periods.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Quotes.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Ranges.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Semicolons.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Slang.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Spacing.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Spelling.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Units.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/We.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/Will.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/WordList.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/meta.json +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/Google/vocab.txt +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/bruin/Ingestr.yml +0 -0
- {ingestr-0.10.0rc4 → ingestr-0.10.1}/styles/config/vocabularies/bruin/accept.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: ingestr
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.1
|
|
4
4
|
Summary: ingestr is a command-line application that ingests data from various sources and stores them in any database.
|
|
5
5
|
Project-URL: Homepage, https://github.com/bruin-data/ingestr
|
|
6
6
|
Project-URL: Issues, https://github.com/bruin-data/ingestr/issues
|
|
@@ -280,6 +280,13 @@ def ingest(
|
|
|
280
280
|
envvar="SQL_LIMIT",
|
|
281
281
|
),
|
|
282
282
|
] = None, # type: ignore
|
|
283
|
+
sql_exclude_columns: Annotated[
|
|
284
|
+
Optional[list[str]],
|
|
285
|
+
typer.Option(
|
|
286
|
+
help="The columns to exclude from the source table",
|
|
287
|
+
envvar="SQL_EXCLUDE_COLUMNS",
|
|
288
|
+
),
|
|
289
|
+
] = [], # type: ignore
|
|
283
290
|
):
|
|
284
291
|
import hashlib
|
|
285
292
|
import tempfile
|
|
@@ -341,6 +348,14 @@ def ingest(
|
|
|
341
348
|
)
|
|
342
349
|
raise typer.Abort()
|
|
343
350
|
|
|
351
|
+
def run_on_resource(source, executable):
|
|
352
|
+
if hasattr(source, "selected_resources") and source.selected_resources:
|
|
353
|
+
resource_names = list(source.selected_resources.keys())
|
|
354
|
+
for res in resource_names:
|
|
355
|
+
executable(source.resources[res])
|
|
356
|
+
else:
|
|
357
|
+
executable(source)
|
|
358
|
+
|
|
344
359
|
track(
|
|
345
360
|
"command_triggered",
|
|
346
361
|
{
|
|
@@ -348,6 +363,13 @@ def ingest(
|
|
|
348
363
|
},
|
|
349
364
|
)
|
|
350
365
|
|
|
366
|
+
clean_sql_exclude_columns = []
|
|
367
|
+
if sql_exclude_columns:
|
|
368
|
+
for col in sql_exclude_columns:
|
|
369
|
+
for possible_col in col.split(","):
|
|
370
|
+
clean_sql_exclude_columns.append(possible_col.strip())
|
|
371
|
+
sql_exclude_columns = clean_sql_exclude_columns
|
|
372
|
+
|
|
351
373
|
dlt.config["data_writer.buffer_max_items"] = page_size
|
|
352
374
|
dlt.config["data_writer.file_max_items"] = loader_file_size
|
|
353
375
|
dlt.config["extract.workers"] = extract_parallelism
|
|
@@ -459,9 +481,6 @@ def ingest(
|
|
|
459
481
|
if factory.source_scheme == "sqlite":
|
|
460
482
|
source_table = "main." + source_table.split(".")[-1]
|
|
461
483
|
|
|
462
|
-
if factory.destination_scheme == "bigquery" and loader_file_format is LoaderFileFormat.parquet:
|
|
463
|
-
dlt.config["destination.bigquery.autodetect_schema"] = True
|
|
464
|
-
|
|
465
484
|
dlt_source = source.dlt_source(
|
|
466
485
|
uri=source_uri,
|
|
467
486
|
table=source_table,
|
|
@@ -473,12 +492,23 @@ def ingest(
|
|
|
473
492
|
page_size=page_size,
|
|
474
493
|
sql_reflection_level=sql_reflection_level.value,
|
|
475
494
|
sql_limit=sql_limit,
|
|
495
|
+
sql_exclude_columns=sql_exclude_columns,
|
|
476
496
|
)
|
|
477
497
|
|
|
478
|
-
dlt_source.add_map(cast_set_to_list)
|
|
498
|
+
run_on_resource(dlt_source, lambda x: x.add_map(cast_set_to_list))
|
|
499
|
+
|
|
500
|
+
def col_h(x):
|
|
501
|
+
if column_hints:
|
|
502
|
+
x.apply_hints(columns=column_hints)
|
|
503
|
+
|
|
504
|
+
run_on_resource(dlt_source, col_h)
|
|
479
505
|
|
|
480
506
|
if original_incremental_strategy == IncrementalStrategy.delete_insert:
|
|
481
|
-
|
|
507
|
+
|
|
508
|
+
def set_primary_key(x):
|
|
509
|
+
x.incremental.primary_key = ()
|
|
510
|
+
|
|
511
|
+
run_on_resource(dlt_source, set_primary_key)
|
|
482
512
|
|
|
483
513
|
if (
|
|
484
514
|
factory.destination_scheme in PARQUET_SUPPORTED_DESTINATIONS
|
|
@@ -510,7 +540,6 @@ def ingest(
|
|
|
510
540
|
loader_file_format=(
|
|
511
541
|
loader_file_format.value if loader_file_format is not None else None # type: ignore
|
|
512
542
|
), # type: ignore
|
|
513
|
-
columns=column_hints,
|
|
514
543
|
)
|
|
515
544
|
|
|
516
545
|
report_errors(run_info)
|
|
@@ -82,7 +82,7 @@ def adjust_source(
|
|
|
82
82
|
type_hints[metric] = KNOWN_TYPE_HINTS[metric]
|
|
83
83
|
|
|
84
84
|
@dlt.resource(
|
|
85
|
-
write_disposition={"disposition": "merge", "strategy": "delete
|
|
85
|
+
write_disposition={"disposition": "merge", "strategy": "delete-insert"},
|
|
86
86
|
merge_key=merge_key,
|
|
87
87
|
primary_key=dimensions,
|
|
88
88
|
columns=type_hints,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from dlt.common.libs.sql_alchemy import Table
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def cast_set_to_list(row):
|
|
5
|
+
# this handles just the sqlalchemy backend for now
|
|
6
|
+
if isinstance(row, dict):
|
|
7
|
+
for key in row.keys():
|
|
8
|
+
if isinstance(row[key], set):
|
|
9
|
+
row[key] = list(row[key])
|
|
10
|
+
return row
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def table_adapter_exclude_columns(cols: list[str]):
|
|
14
|
+
def excluder(table: Table):
|
|
15
|
+
cols_to_remove = [col for col in table._columns if col.name in cols] # type: ignore
|
|
16
|
+
for col in cols_to_remove:
|
|
17
|
+
table._columns.remove(col) # type: ignore
|
|
18
|
+
|
|
19
|
+
return excluder
|
|
@@ -23,6 +23,7 @@ from ingestr.src.arrow import memory_mapped_arrow
|
|
|
23
23
|
from ingestr.src.chess import source
|
|
24
24
|
from ingestr.src.facebook_ads import facebook_ads_source, facebook_insights_source
|
|
25
25
|
from ingestr.src.filesystem import readers
|
|
26
|
+
from ingestr.src.filters import table_adapter_exclude_columns
|
|
26
27
|
from ingestr.src.google_sheets import google_spreadsheet
|
|
27
28
|
from ingestr.src.gorgias import gorgias_source
|
|
28
29
|
from ingestr.src.hubspot import hubspot
|
|
@@ -75,14 +76,17 @@ class SqlSource:
|
|
|
75
76
|
if kwargs.get("sql_limit"):
|
|
76
77
|
|
|
77
78
|
def query_adapter_callback(query, table):
|
|
78
|
-
|
|
79
|
+
query = query.limit(kwargs.get("sql_limit"))
|
|
80
|
+
if kwargs.get("incremental_key"):
|
|
81
|
+
query = query.order_by(kwargs.get("incremental_key"))
|
|
82
|
+
return query
|
|
79
83
|
|
|
80
84
|
def type_adapter_callback(sql_type):
|
|
81
85
|
if isinstance(sql_type, mysql.SET):
|
|
82
86
|
return sa.JSON
|
|
83
87
|
return sql_type
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
builder_res = self.table_builder(
|
|
86
90
|
credentials=ConnectionStringCredentials(uri),
|
|
87
91
|
schema=table_fields.dataset,
|
|
88
92
|
table=table_fields.table,
|
|
@@ -92,9 +96,12 @@ class SqlSource:
|
|
|
92
96
|
reflection_level=reflection_level,
|
|
93
97
|
query_adapter_callback=query_adapter_callback,
|
|
94
98
|
type_adapter_callback=type_adapter_callback,
|
|
99
|
+
table_adapter_callback=table_adapter_exclude_columns(
|
|
100
|
+
kwargs.get("sql_exclude_columns", [])
|
|
101
|
+
),
|
|
95
102
|
)
|
|
96
103
|
|
|
97
|
-
return
|
|
104
|
+
return builder_res
|
|
98
105
|
|
|
99
106
|
|
|
100
107
|
class ArrowMemoryMappedSource:
|
|
@@ -740,7 +747,7 @@ class KafkaSource:
|
|
|
740
747
|
|
|
741
748
|
class AdjustSource:
|
|
742
749
|
def handles_incrementality(self) -> bool:
|
|
743
|
-
return
|
|
750
|
+
return True
|
|
744
751
|
|
|
745
752
|
def dlt_source(self, uri: str, table: str, **kwargs):
|
|
746
753
|
if kwargs.get("incremental_key") and not table.startswith("custom:"):
|
|
@@ -802,7 +809,7 @@ class AdjustSource:
|
|
|
802
809
|
filters_raw = fields[3]
|
|
803
810
|
filters = parse_filters(filters_raw)
|
|
804
811
|
|
|
805
|
-
|
|
812
|
+
src = adjust_source(
|
|
806
813
|
start_date=start_date,
|
|
807
814
|
end_date=end_date,
|
|
808
815
|
api_key=api_key[0],
|
|
@@ -810,7 +817,9 @@ class AdjustSource:
|
|
|
810
817
|
metrics=metrics,
|
|
811
818
|
merge_key=kwargs.get("merge_key"),
|
|
812
819
|
filters=filters,
|
|
813
|
-
)
|
|
820
|
+
)
|
|
821
|
+
|
|
822
|
+
return src.with_resources(table)
|
|
814
823
|
|
|
815
824
|
|
|
816
825
|
class AppsflyerSource:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.10.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.10.0rc4"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|