ingestr 0.13.34__py3-none-any.whl → 0.13.35__py3-none-any.whl
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/src/airtable/__init__.py +3 -2
- ingestr/src/buildinfo.py +1 -1
- ingestr/src/destinations.py +14 -6
- ingestr/src/sources.py +15 -6
- {ingestr-0.13.34.dist-info → ingestr-0.13.35.dist-info}/METADATA +2 -2
- {ingestr-0.13.34.dist-info → ingestr-0.13.35.dist-info}/RECORD +9 -9
- {ingestr-0.13.34.dist-info → ingestr-0.13.35.dist-info}/WHEEL +0 -0
- {ingestr-0.13.34.dist-info → ingestr-0.13.35.dist-info}/entry_points.txt +0 -0
- {ingestr-0.13.34.dist-info → ingestr-0.13.35.dist-info}/licenses/LICENSE.md +0 -0
ingestr/src/airtable/__init__.py
CHANGED
|
@@ -9,7 +9,7 @@ import pyairtable
|
|
|
9
9
|
from dlt.sources import DltResource
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
@dlt.source
|
|
12
|
+
@dlt.source(max_table_nesting=1)
|
|
13
13
|
def airtable_source(
|
|
14
14
|
base_id: str = dlt.config.value,
|
|
15
15
|
table_names: Optional[List[str]] = dlt.config.value,
|
|
@@ -50,12 +50,13 @@ def airtable_resource(
|
|
|
50
50
|
It starts with "app". See https://support.airtable.com/docs/finding-airtable-ids
|
|
51
51
|
table (Dict[str, Any]): Metadata about an airtable, does not contain the actual records
|
|
52
52
|
"""
|
|
53
|
+
|
|
53
54
|
primary_key_id = table["primaryFieldId"]
|
|
54
55
|
primary_key_field = [
|
|
55
56
|
field for field in table["fields"] if field["id"] == primary_key_id
|
|
56
57
|
][0]
|
|
57
58
|
table_name: str = table["name"]
|
|
58
|
-
primary_key: List[str] = [f"fields__{primary_key_field['name']}"]
|
|
59
|
+
primary_key: List[str] = [f"fields__{primary_key_field['name']}".lower()]
|
|
59
60
|
air_table = api.table(base_id, table["id"])
|
|
60
61
|
|
|
61
62
|
# Table.iterate() supports rich customization options, such as chunk size, fields, cell format, timezone, locale, and view
|
ingestr/src/buildinfo.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "v0.13.
|
|
1
|
+
version = "v0.13.35"
|
ingestr/src/destinations.py
CHANGED
|
@@ -235,12 +235,19 @@ class AthenaDestination:
|
|
|
235
235
|
if not bucket.startswith("s3://"):
|
|
236
236
|
bucket = f"s3://{bucket}"
|
|
237
237
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
bucket = bucket.rstrip("/")
|
|
239
|
+
|
|
240
|
+
dest_table = kwargs.get("dest_table", None)
|
|
241
|
+
if not dest_table:
|
|
242
|
+
raise ValueError("A destination table is required to connect to Athena.")
|
|
243
|
+
|
|
244
|
+
dest_table_fields = dest_table.split(".")
|
|
245
|
+
if len(dest_table_fields) != 2:
|
|
246
|
+
raise ValueError(
|
|
247
|
+
f"Table name must be in the format <schema>.<table>, given: {dest_table}"
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
query_result_path = f"{bucket}/{dest_table_fields[0]}_staging/metadata"
|
|
244
251
|
|
|
245
252
|
access_key_id = source_params.get("access_key_id", [None])[0]
|
|
246
253
|
secret_access_key = source_params.get("secret_access_key", [None])[0]
|
|
@@ -285,6 +292,7 @@ class AthenaDestination:
|
|
|
285
292
|
region_name=region_name,
|
|
286
293
|
),
|
|
287
294
|
destination_name=bucket,
|
|
295
|
+
force_iceberg=True,
|
|
288
296
|
)
|
|
289
297
|
|
|
290
298
|
def dlt_run_params(self, uri: str, table: str, **kwargs) -> dict:
|
ingestr/src/sources.py
CHANGED
|
@@ -852,22 +852,31 @@ class AirtableSource:
|
|
|
852
852
|
if not table:
|
|
853
853
|
raise ValueError("Source table is required to connect to Airtable")
|
|
854
854
|
|
|
855
|
-
tables = table.split(",")
|
|
856
|
-
|
|
857
855
|
source_parts = urlparse(uri)
|
|
858
856
|
source_fields = parse_qs(source_parts.query)
|
|
859
|
-
base_id = source_fields.get("base_id")
|
|
860
857
|
access_token = source_fields.get("access_token")
|
|
861
858
|
|
|
862
|
-
if not
|
|
859
|
+
if not access_token:
|
|
863
860
|
raise ValueError(
|
|
864
|
-
"
|
|
861
|
+
"access_token in the URI is required to connect to Airtable"
|
|
865
862
|
)
|
|
866
863
|
|
|
864
|
+
base_id = source_fields.get("base_id", [None])[0]
|
|
865
|
+
clean_table = table
|
|
866
|
+
|
|
867
|
+
table_fields = table.split("/")
|
|
868
|
+
if len(table_fields) == 2:
|
|
869
|
+
clean_table = table_fields[1]
|
|
870
|
+
if not base_id:
|
|
871
|
+
base_id = table_fields[0]
|
|
872
|
+
|
|
873
|
+
if not base_id:
|
|
874
|
+
raise ValueError("base_id in the URI is required to connect to Airtable")
|
|
875
|
+
|
|
867
876
|
from ingestr.src.airtable import airtable_source
|
|
868
877
|
|
|
869
878
|
return airtable_source(
|
|
870
|
-
base_id=base_id
|
|
879
|
+
base_id=base_id, table_names=[clean_table], access_token=access_token[0]
|
|
871
880
|
)
|
|
872
881
|
|
|
873
882
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ingestr
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.35
|
|
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
|
|
@@ -46,7 +46,7 @@ Requires-Dist: databricks-sqlalchemy==1.0.2
|
|
|
46
46
|
Requires-Dist: dataclasses-json==0.6.7
|
|
47
47
|
Requires-Dist: decorator==5.2.1
|
|
48
48
|
Requires-Dist: deprecation==2.1.0
|
|
49
|
-
Requires-Dist: dlt==1.
|
|
49
|
+
Requires-Dist: dlt==1.10.0
|
|
50
50
|
Requires-Dist: dnspython==2.7.0
|
|
51
51
|
Requires-Dist: duckdb-engine==0.17.0
|
|
52
52
|
Requires-Dist: duckdb==1.2.1
|
|
@@ -2,21 +2,21 @@ ingestr/conftest.py,sha256=Q03FIJIZpLBbpj55cfCHIKEjc1FCvWJhMF2cidUJKQU,1748
|
|
|
2
2
|
ingestr/main.py,sha256=mRlGSqi2sHcZ2AKlwn5MqoMvFxXlSjcZxmPJr76rmRk,25187
|
|
3
3
|
ingestr/src/.gitignore,sha256=8cX1AZTSI0TcdZFGTmS_oyBjpfCzhOEt0DdAo2dFIY8,203
|
|
4
4
|
ingestr/src/blob.py,sha256=onMe5ZHxPXTdcB_s2oGNdMo-XQJ3ajwOsWE9eSTGFmc,1495
|
|
5
|
-
ingestr/src/buildinfo.py,sha256
|
|
6
|
-
ingestr/src/destinations.py,sha256=
|
|
5
|
+
ingestr/src/buildinfo.py,sha256=-fdK0r3dEieckm9FbunVnN7VEWpVvtyhbo9bq89u0Es,21
|
|
6
|
+
ingestr/src/destinations.py,sha256=Z79f01BSmEaXnQno2IQVt4Th4dmD-BiOQXlibZJ5sTw,13180
|
|
7
7
|
ingestr/src/errors.py,sha256=Ufs4_DfE77_E3vnA1fOQdi6cmuLVNm7_SbFLkL1XPGk,686
|
|
8
8
|
ingestr/src/factory.py,sha256=659h_sVRBhtPv2dvtOK8tf3PtUhlK3KsWLrb20_iQKw,5333
|
|
9
9
|
ingestr/src/filters.py,sha256=C-_TIVkF_cxZBgG-Run2Oyn0TAhJgA8IWXZ-OPY3uek,1136
|
|
10
10
|
ingestr/src/loader.py,sha256=9NaWAyfkXdqAZSS-N72Iwo36Lbx4PyqIfaaH1dNdkFs,1712
|
|
11
11
|
ingestr/src/partition.py,sha256=BrIP6wFJvyR7Nus_3ElnfxknUXeCipK_E_bB8kZowfc,969
|
|
12
12
|
ingestr/src/resource.py,sha256=XG-sbBapFVEM7OhHQFQRTdTLlh-mHB-N4V1t8F8Tsww,543
|
|
13
|
-
ingestr/src/sources.py,sha256=
|
|
13
|
+
ingestr/src/sources.py,sha256=Xinebylg-PqzyQ-r2wFukqhsPsv611fEoTvTWY1L-B4,76461
|
|
14
14
|
ingestr/src/table_definition.py,sha256=REbAbqdlmUMUuRh8nEQRreWjPVOQ5ZcfqGkScKdCrmk,390
|
|
15
15
|
ingestr/src/time.py,sha256=H_Fk2J4ShXyUM-EMY7MqCLZQhlnZMZvO952bmZPc4yE,254
|
|
16
16
|
ingestr/src/version.py,sha256=J_2xgZ0mKlvuHcjdKCx2nlioneLH0I47JiU_Slr_Nwc,189
|
|
17
17
|
ingestr/src/adjust/__init__.py,sha256=ULjtJqrNS6XDvUyGl0tjl12-tLyXlCgeFe2icTbtu3Q,3255
|
|
18
18
|
ingestr/src/adjust/adjust_helpers.py,sha256=IHSS94A7enOWkZ8cP5iW3RdYt0Xl3qZGAmDc1Xy4qkI,3802
|
|
19
|
-
ingestr/src/airtable/__init__.py,sha256=
|
|
19
|
+
ingestr/src/airtable/__init__.py,sha256=XzRsS39xszUlh_s7P1_zq5v8vLfjz3m-NtTPaa8TTZU,2818
|
|
20
20
|
ingestr/src/applovin/__init__.py,sha256=X_YCLppPrnL8KXfYWICE_uDfMzHHH3JZ-DBGZ1RlaOI,6984
|
|
21
21
|
ingestr/src/applovin_max/__init__.py,sha256=ZrxOUSirGxkGDmM9wsQO3anwNVzqtoCwN_OuCXfPkXE,3285
|
|
22
22
|
ingestr/src/appsflyer/__init__.py,sha256=QoK-B3cYYMD3bqzQaLWNH6FkJyjRbzRkBF2n6urxubs,8071
|
|
@@ -122,8 +122,8 @@ ingestr/testdata/delete_insert_part2.csv,sha256=B_KUzpzbNdDY_n7wWop1mT2cz36TmayS
|
|
|
122
122
|
ingestr/testdata/merge_expected.csv,sha256=DReHqWGnQMsf2PBv_Q2pfjsgvikYFnf1zYcQZ7ZqYN0,276
|
|
123
123
|
ingestr/testdata/merge_part1.csv,sha256=Pw8Z9IDKcNU0qQHx1z6BUf4rF_-SxKGFOvymCt4OY9I,185
|
|
124
124
|
ingestr/testdata/merge_part2.csv,sha256=T_GiWxA81SN63_tMOIuemcvboEFeAmbKc7xRXvL9esw,287
|
|
125
|
-
ingestr-0.13.
|
|
126
|
-
ingestr-0.13.
|
|
127
|
-
ingestr-0.13.
|
|
128
|
-
ingestr-0.13.
|
|
129
|
-
ingestr-0.13.
|
|
125
|
+
ingestr-0.13.35.dist-info/METADATA,sha256=HazXK_VyPcaappMDArhp7cBeRRaVc1oOTzgo3S7Gtr0,13575
|
|
126
|
+
ingestr-0.13.35.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
127
|
+
ingestr-0.13.35.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
|
|
128
|
+
ingestr-0.13.35.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
|
|
129
|
+
ingestr-0.13.35.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|