ingestr 0.13.76__py3-none-any.whl → 0.13.78__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/buildinfo.py +1 -1
- ingestr/src/github/__init__.py +6 -6
- ingestr/src/github/helpers.py +0 -1
- ingestr/src/mongodb/helpers.py +10 -2
- ingestr/src/sources.py +2 -2
- {ingestr-0.13.76.dist-info → ingestr-0.13.78.dist-info}/METADATA +1 -1
- {ingestr-0.13.76.dist-info → ingestr-0.13.78.dist-info}/RECORD +10 -10
- {ingestr-0.13.76.dist-info → ingestr-0.13.78.dist-info}/WHEEL +0 -0
- {ingestr-0.13.76.dist-info → ingestr-0.13.78.dist-info}/entry_points.txt +0 -0
- {ingestr-0.13.76.dist-info → ingestr-0.13.78.dist-info}/licenses/LICENSE.md +0 -0
ingestr/src/buildinfo.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "v0.13.
|
|
1
|
+
version = "v0.13.78"
|
ingestr/src/github/__init__.py
CHANGED
|
@@ -72,7 +72,7 @@ def github_repo_events(
|
|
|
72
72
|
name: str,
|
|
73
73
|
access_token: str,
|
|
74
74
|
start_date: pendulum.DateTime,
|
|
75
|
-
end_date: pendulum.DateTime,
|
|
75
|
+
end_date: Optional[pendulum.DateTime] = None,
|
|
76
76
|
) -> DltResource:
|
|
77
77
|
"""Gets events for repository `name` with owner `owner` incrementally.
|
|
78
78
|
|
|
@@ -91,12 +91,12 @@ def github_repo_events(
|
|
|
91
91
|
"""
|
|
92
92
|
|
|
93
93
|
# use naming function in table name to generate separate tables for each event
|
|
94
|
-
@dlt.resource(primary_key="id", table_name=lambda i: i["type"])
|
|
94
|
+
@dlt.resource(primary_key= "id", table_name=lambda i: i["type"], write_disposition="merge")
|
|
95
95
|
def repo_events(
|
|
96
96
|
last_created_at: dlt.sources.incremental[str] = dlt.sources.incremental(
|
|
97
97
|
"created_at",
|
|
98
98
|
initial_value=start_date.isoformat(),
|
|
99
|
-
end_value=end_date.isoformat(),
|
|
99
|
+
end_value=end_date.isoformat() if end_date else None,
|
|
100
100
|
last_value_func=max,
|
|
101
101
|
range_end="closed",
|
|
102
102
|
range_start="closed",
|
|
@@ -105,7 +105,7 @@ def github_repo_events(
|
|
|
105
105
|
repos_path = (
|
|
106
106
|
f"/repos/{urllib.parse.quote(owner)}/{urllib.parse.quote(name)}/events"
|
|
107
107
|
)
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
# Get the date range from the incremental state
|
|
110
110
|
start_filter = pendulum.parse(
|
|
111
111
|
last_created_at.last_value or last_created_at.initial_value
|
|
@@ -113,9 +113,9 @@ def github_repo_events(
|
|
|
113
113
|
end_filter = (
|
|
114
114
|
pendulum.parse(last_created_at.end_value)
|
|
115
115
|
if last_created_at.end_value
|
|
116
|
-
else
|
|
116
|
+
else pendulum.now()
|
|
117
117
|
)
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
for page in get_rest_pages(access_token, repos_path + "?per_page=100"):
|
|
120
120
|
# Filter events by date range
|
|
121
121
|
filtered_events = []
|
ingestr/src/github/helpers.py
CHANGED
ingestr/src/mongodb/helpers.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Mongo database source helpers"""
|
|
2
2
|
|
|
3
|
+
import json
|
|
3
4
|
from itertools import islice
|
|
4
5
|
from typing import (
|
|
5
6
|
TYPE_CHECKING,
|
|
@@ -204,7 +205,14 @@ class CollectionLoader:
|
|
|
204
205
|
cursor = self._limit(cursor, limit)
|
|
205
206
|
|
|
206
207
|
while docs_slice := list(islice(cursor, self.chunk_size)):
|
|
207
|
-
|
|
208
|
+
res = map_nested_in_place(convert_mongo_objs, docs_slice)
|
|
209
|
+
if len(res) > 0 and "_id" in res[0] and isinstance(res[0]["_id"], dict):
|
|
210
|
+
yield dlt.mark.with_hints(
|
|
211
|
+
res,
|
|
212
|
+
dlt.mark.make_hints(columns={"_id": {"data_type": "json"} }),
|
|
213
|
+
)
|
|
214
|
+
else:
|
|
215
|
+
yield res
|
|
208
216
|
|
|
209
217
|
|
|
210
218
|
class CollectionLoaderParallel(CollectionLoader):
|
|
@@ -531,7 +539,7 @@ def collection_documents(
|
|
|
531
539
|
LoaderClass = CollectionArrowLoader # type: ignore
|
|
532
540
|
else:
|
|
533
541
|
LoaderClass = CollectionLoader # type: ignore
|
|
534
|
-
|
|
542
|
+
|
|
535
543
|
loader = LoaderClass(
|
|
536
544
|
client, collection, incremental=incremental, chunk_size=chunk_size
|
|
537
545
|
)
|
ingestr/src/sources.py
CHANGED
|
@@ -428,7 +428,7 @@ class MongoDbSource:
|
|
|
428
428
|
connection_url=uri,
|
|
429
429
|
database=table_fields.dataset,
|
|
430
430
|
collection=table_fields.table,
|
|
431
|
-
parallel=
|
|
431
|
+
parallel=False,
|
|
432
432
|
incremental=incremental,
|
|
433
433
|
)
|
|
434
434
|
table_instance.max_table_nesting = 1
|
|
@@ -1817,7 +1817,7 @@ class GitHubSource:
|
|
|
1817
1817
|
start_date = kwargs.get("interval_start") or pendulum.now().subtract(
|
|
1818
1818
|
days=30
|
|
1819
1819
|
)
|
|
1820
|
-
end_date = kwargs.get("interval_end") or
|
|
1820
|
+
end_date = kwargs.get("interval_end") or None
|
|
1821
1821
|
|
|
1822
1822
|
if isinstance(start_date, str):
|
|
1823
1823
|
start_date = pendulum.parse(start_date)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ingestr
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.78
|
|
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
|
|
@@ -2,7 +2,7 @@ ingestr/conftest.py,sha256=OE2yxeTCosS9CUFVuqNypm-2ftYvVBeeq7egm3878cI,1981
|
|
|
2
2
|
ingestr/main.py,sha256=QsNVrz5_NgRUkvfExnd-2E02TGmWivPuop5hYinVAjM,26513
|
|
3
3
|
ingestr/src/.gitignore,sha256=8cX1AZTSI0TcdZFGTmS_oyBjpfCzhOEt0DdAo2dFIY8,203
|
|
4
4
|
ingestr/src/blob.py,sha256=UUWMjHUuoR9xP1XZQ6UANQmnMVyDx3d0X4-2FQC271I,2138
|
|
5
|
-
ingestr/src/buildinfo.py,sha256=
|
|
5
|
+
ingestr/src/buildinfo.py,sha256=cARFQnpIzB5xD3JEaIPIkee7dO80kbLs4M_XypNnwSI,21
|
|
6
6
|
ingestr/src/destinations.py,sha256=ivTPio0zzqLRx22i597pxZHMNClz-XvYSyCaCPuGd8g,22248
|
|
7
7
|
ingestr/src/errors.py,sha256=Ufs4_DfE77_E3vnA1fOQdi6cmuLVNm7_SbFLkL1XPGk,686
|
|
8
8
|
ingestr/src/factory.py,sha256=q_rSi4gYMfxnGvzhytPRAgC08N40nqDISvXwl7i-E_M,6655
|
|
@@ -11,7 +11,7 @@ ingestr/src/http_client.py,sha256=bxqsk6nJNXCo-79gW04B53DQO-yr25vaSsqP0AKtjx4,73
|
|
|
11
11
|
ingestr/src/loader.py,sha256=9NaWAyfkXdqAZSS-N72Iwo36Lbx4PyqIfaaH1dNdkFs,1712
|
|
12
12
|
ingestr/src/partition.py,sha256=BrIP6wFJvyR7Nus_3ElnfxknUXeCipK_E_bB8kZowfc,969
|
|
13
13
|
ingestr/src/resource.py,sha256=ZqmZxFQVGlF8rFPhBiUB08HES0yoTj8sZ--jKfaaVps,1164
|
|
14
|
-
ingestr/src/sources.py,sha256=
|
|
14
|
+
ingestr/src/sources.py,sha256=1A1tZKA1NUQnHdgvGPKHuRG5o8lNuCe7bIxB0n73eJw,107635
|
|
15
15
|
ingestr/src/table_definition.py,sha256=REbAbqdlmUMUuRh8nEQRreWjPVOQ5ZcfqGkScKdCrmk,390
|
|
16
16
|
ingestr/src/time.py,sha256=H_Fk2J4ShXyUM-EMY7MqCLZQhlnZMZvO952bmZPc4yE,254
|
|
17
17
|
ingestr/src/version.py,sha256=J_2xgZ0mKlvuHcjdKCx2nlioneLH0I47JiU_Slr_Nwc,189
|
|
@@ -54,8 +54,8 @@ ingestr/src/frankfurter/helpers.py,sha256=SyrkRTDqvKdQxRHTV5kcSeVG3FEnaK5zxHyNyq
|
|
|
54
54
|
ingestr/src/freshdesk/__init__.py,sha256=uFQW_cJyymxtHQiYb_xjzZAklc487L0n9GkgHgC7yAI,2618
|
|
55
55
|
ingestr/src/freshdesk/freshdesk_client.py,sha256=3z5Yc008ADzRcJWtNc00PwjkLzG-RMI8jVIOOyYA-Rw,4088
|
|
56
56
|
ingestr/src/freshdesk/settings.py,sha256=0Wr_OMnUZcTlry7BmALssLxD2yh686JW4moLNv12Jnw,409
|
|
57
|
-
ingestr/src/github/__init__.py,sha256=
|
|
58
|
-
ingestr/src/github/helpers.py,sha256=
|
|
57
|
+
ingestr/src/github/__init__.py,sha256=R71y33KqzxDTvCLSGj2H2EztfGqsWGR9ZgcaurC1-A4,7220
|
|
58
|
+
ingestr/src/github/helpers.py,sha256=hge8orylwiScRcMftlv4oSZ6ORvVANwHCPAGkg95FtI,6758
|
|
59
59
|
ingestr/src/github/queries.py,sha256=W34C02jUEdjFmOE7f7u9xvYyBNDMfVZAu0JIRZI2mkU,2302
|
|
60
60
|
ingestr/src/github/settings.py,sha256=N5ahWrDIQ_4IWV9i-hTXxyYduqY9Ym2BTwqsWxcDdJ8,258
|
|
61
61
|
ingestr/src/google_ads/__init__.py,sha256=bH0TtnRWcOUESezpvoA7VEUHAq_0ITGQeX4GGVBfl1I,3725
|
|
@@ -93,7 +93,7 @@ ingestr/src/linkedin_ads/helpers.py,sha256=eUWudRVlXl4kqIhfXQ1eVsUpZwJn7UFqKSpnb
|
|
|
93
93
|
ingestr/src/mixpanel/__init__.py,sha256=s1QtqMP0BTGW6YtdCabJFWj7lEn7KujzELwGpBOQgfs,1796
|
|
94
94
|
ingestr/src/mixpanel/client.py,sha256=c_reouegOVYBOwHLfgYFwpmkba0Sxro1Zkml07NCYf0,3602
|
|
95
95
|
ingestr/src/mongodb/__init__.py,sha256=T-RYPS_skl_2gNVfYWWXan2bVQYmm0bFBcCCqG5ejvg,7275
|
|
96
|
-
ingestr/src/mongodb/helpers.py,sha256=
|
|
96
|
+
ingestr/src/mongodb/helpers.py,sha256=8pjNYZu4k2rkR9dItTMAnPaRdF1kroqLYX9FZ34RTqo,24491
|
|
97
97
|
ingestr/src/notion/__init__.py,sha256=36wUui8finbc85ObkRMq8boMraXMUehdABN_AMe_hzA,1834
|
|
98
98
|
ingestr/src/notion/settings.py,sha256=MwQVZViJtnvOegfjXYc_pJ50oUYgSRPgwqu7TvpeMOA,82
|
|
99
99
|
ingestr/src/notion/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -151,8 +151,8 @@ ingestr/testdata/merge_expected.csv,sha256=DReHqWGnQMsf2PBv_Q2pfjsgvikYFnf1zYcQZ
|
|
|
151
151
|
ingestr/testdata/merge_part1.csv,sha256=Pw8Z9IDKcNU0qQHx1z6BUf4rF_-SxKGFOvymCt4OY9I,185
|
|
152
152
|
ingestr/testdata/merge_part2.csv,sha256=T_GiWxA81SN63_tMOIuemcvboEFeAmbKc7xRXvL9esw,287
|
|
153
153
|
ingestr/tests/unit/test_smartsheets.py,sha256=eiC2CCO4iNJcuN36ONvqmEDryCA1bA1REpayHpu42lk,5058
|
|
154
|
-
ingestr-0.13.
|
|
155
|
-
ingestr-0.13.
|
|
156
|
-
ingestr-0.13.
|
|
157
|
-
ingestr-0.13.
|
|
158
|
-
ingestr-0.13.
|
|
154
|
+
ingestr-0.13.78.dist-info/METADATA,sha256=Q7ofO2TRuTOUb4fhZvyr_kejvaOM2OwCrq3FnCLEk6U,15093
|
|
155
|
+
ingestr-0.13.78.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
156
|
+
ingestr-0.13.78.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
|
|
157
|
+
ingestr-0.13.78.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
|
|
158
|
+
ingestr-0.13.78.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|