ingestr 0.3.0__tar.gz → 0.3.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.3.0 → ingestr-0.3.1}/PKG-INFO +1 -1
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/main.py +33 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/main_test.py +16 -1
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/sources.py +1 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/sources_test.py +4 -2
- ingestr-0.3.1/ingestr/src/version.py +1 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/testdata/test_append.db +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/testdata/test_create_replace.db +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/testdata/test_delete_insert_with_timerange.db +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/testdata/test_delete_insert_without_primary_key.db +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/testdata/test_merge_with_primary_key.db +0 -0
- ingestr-0.3.0/burakdb +0 -0
- ingestr-0.3.0/ingestr/src/version.py +0 -1
- {ingestr-0.3.0 → ingestr-0.3.1}/.dockerignore +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/.github/workflows/deploy-docs.yml +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/.github/workflows/docker.yml +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/.gitignore +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/Dockerfile +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/LICENSE.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/Makefile +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/README.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/.vitepress/config.mjs +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/.vitepress/theme/custom.css +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/.vitepress/theme/index.js +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/commands/example-uris.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/commands/ingest.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/getting-started/core-concepts.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/getting-started/incremental-loading.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/getting-started/quickstart.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/getting-started/telemetry.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/index.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/bigquery.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/csv.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/databricks.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/duckdb.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/images/notion_example.png +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/mongodb.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/mssql.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/mysql.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/notion.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/oracle.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/overview.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/postgres.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/redshift.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/snowflake.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/docs/supported-sources/sqlite.md +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/destinations.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/destinations_test.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/factory.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/factory_test.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/mongodb/__init__.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/mongodb/helpers.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/notion/__init__.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/notion/helpers/__init__.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/notion/helpers/client.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/notion/helpers/database.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/notion/settings.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/sql_database/__init__.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/sql_database/helpers.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/sql_database/override.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/sql_database/schema_types.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/telemetry/event.py +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/src/testdata/fakebqcredentials.json +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/ingestr/testdata/.gitignore +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/package-lock.json +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/package.json +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/pyproject.toml +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/requirements-dev.txt +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/requirements.txt +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/resources/demo.gif +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/resources/demo.tape +0 -0
- {ingestr-0.3.0 → ingestr-0.3.1}/resources/ingestr.svg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: ingestr
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.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
|
|
@@ -32,6 +32,15 @@ DATE_FORMATS = [
|
|
|
32
32
|
"%Y-%m-%dT%H:%M:%S.%f%z",
|
|
33
33
|
]
|
|
34
34
|
|
|
35
|
+
# https://dlthub.com/docs/dlt-ecosystem/file-formats/parquet#supported-destinations
|
|
36
|
+
PARQUET_SUPPORTED_DESTINATIONS = [
|
|
37
|
+
"bigquery",
|
|
38
|
+
"duckdb",
|
|
39
|
+
"snowflake",
|
|
40
|
+
"databricks",
|
|
41
|
+
"synapse",
|
|
42
|
+
]
|
|
43
|
+
|
|
35
44
|
|
|
36
45
|
class SpinnerCollector(Collector):
|
|
37
46
|
status: Status
|
|
@@ -155,6 +164,20 @@ def ingest(
|
|
|
155
164
|
envvar="PROGRESS",
|
|
156
165
|
),
|
|
157
166
|
] = "interactive", # type: ignore
|
|
167
|
+
sql_backend: Annotated[
|
|
168
|
+
Optional[str],
|
|
169
|
+
typer.Option(
|
|
170
|
+
help="The SQL backend to use, must be one of 'sqlalchemy', 'pyarrow'",
|
|
171
|
+
envvar="SQL_BACKEND",
|
|
172
|
+
),
|
|
173
|
+
] = "pyarrow", # type: ignore
|
|
174
|
+
loader_file_format: Annotated[
|
|
175
|
+
Optional[str],
|
|
176
|
+
typer.Option(
|
|
177
|
+
help="The file format to use when loading data, must be one of 'jsonl', 'parquet', 'default'",
|
|
178
|
+
envvar="LOADER_FILE_FORMAT",
|
|
179
|
+
),
|
|
180
|
+
] = "default", # type: ignore
|
|
158
181
|
):
|
|
159
182
|
track(
|
|
160
183
|
"command_triggered",
|
|
@@ -240,11 +263,20 @@ def ingest(
|
|
|
240
263
|
merge_key=merge_key,
|
|
241
264
|
interval_start=interval_start,
|
|
242
265
|
interval_end=interval_end,
|
|
266
|
+
sql_backend=sql_backend,
|
|
243
267
|
)
|
|
244
268
|
|
|
245
269
|
if original_incremental_strategy == "delete+insert":
|
|
246
270
|
dlt_source.incremental.primary_key = ()
|
|
247
271
|
|
|
272
|
+
if (
|
|
273
|
+
factory.destination_scheme in PARQUET_SUPPORTED_DESTINATIONS
|
|
274
|
+
and loader_file_format == "default"
|
|
275
|
+
):
|
|
276
|
+
loader_file_format = "parquet"
|
|
277
|
+
elif loader_file_format == "default":
|
|
278
|
+
loader_file_format = "jsonl"
|
|
279
|
+
|
|
248
280
|
run_info = pipeline.run(
|
|
249
281
|
dlt_source,
|
|
250
282
|
**destination.dlt_run_params(
|
|
@@ -253,6 +285,7 @@ def ingest(
|
|
|
253
285
|
),
|
|
254
286
|
write_disposition=incremental_strategy, # type: ignore
|
|
255
287
|
primary_key=(primary_key if primary_key and len(primary_key) > 0 else None), # type: ignore
|
|
288
|
+
loader_file_format=loader_file_format, # type: ignore
|
|
256
289
|
)
|
|
257
290
|
|
|
258
291
|
destination.post_load()
|
|
@@ -24,6 +24,8 @@ def invoke_ingest_command(
|
|
|
24
24
|
merge_key=None,
|
|
25
25
|
interval_start=None,
|
|
26
26
|
interval_end=None,
|
|
27
|
+
sql_backend=None,
|
|
28
|
+
loader_file_format=None,
|
|
27
29
|
):
|
|
28
30
|
args = [
|
|
29
31
|
"ingest",
|
|
@@ -61,6 +63,14 @@ def invoke_ingest_command(
|
|
|
61
63
|
args.append("--interval-end")
|
|
62
64
|
args.append(interval_end)
|
|
63
65
|
|
|
66
|
+
if sql_backend:
|
|
67
|
+
args.append("--sql-backend")
|
|
68
|
+
args.append(sql_backend)
|
|
69
|
+
|
|
70
|
+
if loader_file_format:
|
|
71
|
+
args.append("--loader-file-format")
|
|
72
|
+
args.append(loader_file_format)
|
|
73
|
+
|
|
64
74
|
result = runner.invoke(
|
|
65
75
|
app,
|
|
66
76
|
args,
|
|
@@ -93,7 +103,6 @@ def test_create_replace():
|
|
|
93
103
|
"testschema.output",
|
|
94
104
|
)
|
|
95
105
|
|
|
96
|
-
print(result.stdout)
|
|
97
106
|
assert result.exit_code == 0
|
|
98
107
|
|
|
99
108
|
res = conn.sql(
|
|
@@ -138,6 +147,7 @@ def test_append():
|
|
|
138
147
|
"testschema_append.output",
|
|
139
148
|
"append",
|
|
140
149
|
"updated_at",
|
|
150
|
+
sql_backend="sqlalchemy",
|
|
141
151
|
)
|
|
142
152
|
assert res.exit_code == 0
|
|
143
153
|
|
|
@@ -194,6 +204,7 @@ def test_merge_with_primary_key():
|
|
|
194
204
|
"merge",
|
|
195
205
|
"updated_at",
|
|
196
206
|
"id",
|
|
207
|
+
sql_backend="sqlalchemy",
|
|
197
208
|
)
|
|
198
209
|
assert res.exit_code == 0
|
|
199
210
|
return res
|
|
@@ -351,6 +362,8 @@ def test_delete_insert_without_primary_key():
|
|
|
351
362
|
"testschema_delete_insert.output",
|
|
352
363
|
inc_strategy="delete+insert",
|
|
353
364
|
inc_key="updated_at",
|
|
365
|
+
sql_backend="sqlalchemy",
|
|
366
|
+
loader_file_format="jsonl",
|
|
354
367
|
)
|
|
355
368
|
assert res.exit_code == 0
|
|
356
369
|
return res
|
|
@@ -465,6 +478,8 @@ def test_delete_insert_with_timerange():
|
|
|
465
478
|
inc_key="updated_at",
|
|
466
479
|
interval_start=start_date,
|
|
467
480
|
interval_end=end_date,
|
|
481
|
+
sql_backend="sqlalchemy",
|
|
482
|
+
loader_file_format="jsonl",
|
|
468
483
|
)
|
|
469
484
|
assert res.exit_code == 0
|
|
470
485
|
return res
|
|
@@ -22,10 +22,11 @@ class SqlSourceTest(unittest.TestCase):
|
|
|
22
22
|
table = "schema.table"
|
|
23
23
|
|
|
24
24
|
# monkey patch the sql_table function
|
|
25
|
-
def sql_table(credentials, schema, table, incremental, merge_key):
|
|
25
|
+
def sql_table(credentials, schema, table, incremental, merge_key, backend):
|
|
26
26
|
self.assertEqual(credentials, uri)
|
|
27
27
|
self.assertEqual(schema, "schema")
|
|
28
28
|
self.assertEqual(table, "table")
|
|
29
|
+
self.assertEqual(backend, "sqlalchemy")
|
|
29
30
|
self.assertIsNone(incremental)
|
|
30
31
|
self.assertIsNone(merge_key)
|
|
31
32
|
return dlt.resource()
|
|
@@ -40,10 +41,11 @@ class SqlSourceTest(unittest.TestCase):
|
|
|
40
41
|
incremental_key = "id"
|
|
41
42
|
|
|
42
43
|
# monkey patch the sql_table function
|
|
43
|
-
def sql_table(credentials, schema, table, incremental, merge_key):
|
|
44
|
+
def sql_table(credentials, schema, table, incremental, merge_key, backend):
|
|
44
45
|
self.assertEqual(credentials, uri)
|
|
45
46
|
self.assertEqual(schema, "schema")
|
|
46
47
|
self.assertEqual(table, "table")
|
|
48
|
+
self.assertEqual(backend, "sqlalchemy")
|
|
47
49
|
self.assertIsInstance(incremental, dlt.sources.incremental)
|
|
48
50
|
self.assertEqual(incremental.cursor_path, incremental_key)
|
|
49
51
|
self.assertIsNone(merge_key)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.1"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
ingestr-0.3.0/burakdb
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.0"
|
|
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
|