ingestr 0.10.2__py3-none-any.whl → 0.10.4__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/main.py CHANGED
@@ -288,6 +288,7 @@ def ingest(
288
288
  ),
289
289
  ] = [], # type: ignore
290
290
  ):
291
+ # TODO(turtledev): can't we move this to the top of this file?
291
292
  import hashlib
292
293
  import tempfile
293
294
  from datetime import datetime
@@ -383,6 +384,15 @@ def ingest(
383
384
  )
384
385
 
385
386
  factory = SourceDestinationFactory(source_uri, dest_uri)
387
+ track(
388
+ "command_running",
389
+ {
390
+ "command": "ingest",
391
+ "source_type": factory.source_scheme,
392
+ "destination_type": factory.destination_scheme,
393
+ },
394
+ )
395
+
386
396
  source = factory.get_source()
387
397
  destination = factory.get_destination()
388
398
 
@@ -67,13 +67,16 @@ def adjust_source(
67
67
  filters=filters,
68
68
  )
69
69
 
70
+ if not dimensions:
71
+ return campaigns, creatives
72
+
70
73
  merge_key = merge_key
74
+ type_hints = {}
71
75
  for dimension in REQUIRED_CUSTOM_DIMENSIONS:
72
76
  if dimension in dimensions:
73
77
  merge_key = dimension
74
78
  break
75
79
 
76
- type_hints = {}
77
80
  for dimension in dimensions:
78
81
  if dimension in KNOWN_TYPE_HINTS:
79
82
  type_hints[dimension] = KNOWN_TYPE_HINTS[dimension]
@@ -12,7 +12,7 @@ from .helpers import get_path_with_retry, get_url_with_retry, validate_month_str
12
12
  from .settings import UNOFFICIAL_CHESS_API_URL
13
13
 
14
14
 
15
- @dlt.source(name="chess")
15
+ @dlt.source(name="chess", max_table_nesting=0)
16
16
  def source(
17
17
  players: List[str], start_month: str = None, end_month: str = None
18
18
  ) -> Sequence[DltResource]:
@@ -250,7 +250,14 @@ class AthenaDestination:
250
250
  )
251
251
 
252
252
  def dlt_run_params(self, uri: str, table: str, **kwargs) -> dict:
253
- return {}
253
+ table_fields = table.split(".")
254
+ if len(table_fields) != 2:
255
+ raise ValueError("Table name must be in the format <schema>.<table>")
256
+ return {
257
+ "table_format": "iceberg",
258
+ "dataset_name": table_fields[-2],
259
+ "table_name": table_fields[-1],
260
+ }
254
261
 
255
262
  def post_load(self):
256
263
  pass
@@ -50,7 +50,7 @@ from .settings import (
50
50
  THubspotObjectType = Literal["company", "contact", "deal", "ticket", "product", "quote"]
51
51
 
52
52
 
53
- @dlt.source(name="hubspot")
53
+ @dlt.source(name="hubspot", max_table_nesting=0)
54
54
  def hubspot(
55
55
  api_key: str = dlt.secrets.value,
56
56
  include_history: bool = False,
ingestr/src/sources.py CHANGED
@@ -622,7 +622,7 @@ class HubspotSource:
622
622
 
623
623
  class AirtableSource:
624
624
  def handles_incrementality(self) -> bool:
625
- return True
625
+ return False
626
626
 
627
627
  # airtable://?access_token=<access_token>&base_id=<base_id>
628
628
 
@@ -11,7 +11,7 @@ from .helpers import pagination, transform_date
11
11
  from .settings import ENDPOINTS, INCREMENTAL_ENDPOINTS
12
12
 
13
13
 
14
- @dlt.source
14
+ @dlt.source(max_table_nesting=0)
15
15
  def stripe_source(
16
16
  endpoints: Tuple[str, ...] = ENDPOINTS,
17
17
  stripe_secret_key: str = dlt.secrets.value,
ingestr/src/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.10.2"
1
+ __version__ = "0.10.4"
@@ -23,7 +23,6 @@ from .settings import (
23
23
  TALK_ENDPOINTS,
24
24
  )
25
25
 
26
-
27
26
  @dlt.source(max_table_nesting=0)
28
27
  def zendesk_talk(
29
28
  credentials: TZendeskCredentials = dlt.secrets.value,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ingestr
3
- Version: 0.10.2
3
+ Version: 0.10.4
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
@@ -74,11 +74,20 @@ ingestr is a command-line app that allows you to ingest data from any source int
74
74
  ingestr takes away the complexity of managing any backend or writing any code for ingesting data, simply run the command and watch the data land on its destination.
75
75
 
76
76
  ## Installation
77
+ We recommend using [uv](https://github.com/astral-sh/uv) to run `ingestr`.
77
78
 
78
79
  ```
79
- pip install ingestr
80
+ pip install uv
81
+ uvx ingestr
80
82
  ```
81
83
 
84
+ Alternatively, if you'd like to install it globally:
85
+ ```
86
+ uv pip install --system ingestr
87
+ ```
88
+
89
+ While installation with vanilla `pip` is possible, it's an order of magnitude slower.
90
+
82
91
  ## Quickstart
83
92
 
84
93
  ```bash
@@ -104,6 +113,13 @@ You can see the full documentation [here](https://bruin-data.github.io/ingestr/g
104
113
 
105
114
  Join our Slack community [here](https://join.slack.com/t/bruindatacommunity/shared_invite/zt-2dl2i8foy-bVsuMUauHeN9M2laVm3ZVg).
106
115
 
116
+ ## Contributing
117
+
118
+ Pull requests are welcome. However, please open an issue first to discuss what you would like to change. We maybe able to offer you help and feedback regarding any changes you would like to make.
119
+
120
+ > [!NOTE]
121
+ > After cloning `ingestr` make sure to run `make setup` to install githooks.
122
+
107
123
  ## Supported sources & destinations
108
124
 
109
125
  <table>
@@ -1,18 +1,18 @@
1
- ingestr/main.py,sha256=Uq0GTfCtlYu94Iw41AWhexZjgNdaEi7SqxkRAl0iTCg,22001
1
+ ingestr/main.py,sha256=wkU2uLMy1q8YarJ9mXNfJepeRjp6AuPDeNDOmMUt6n0,22309
2
2
  ingestr/src/.gitignore,sha256=8cX1AZTSI0TcdZFGTmS_oyBjpfCzhOEt0DdAo2dFIY8,203
3
- ingestr/src/destinations.py,sha256=wT76Pi3JBbzfKj2goy4-L_XDPfjyPK6b95zyRxksr9g,8555
3
+ ingestr/src/destinations.py,sha256=zcHJIIHAZmcD9sJomd6G1Bc-1KsxnBD2aByOSV_9L3g,8850
4
4
  ingestr/src/factory.py,sha256=nYWgWQINQEQKPeELwGY7MCeiOSoCP6JDPozfKKyGNXk,5013
5
5
  ingestr/src/filters.py,sha256=0JQXeAr2APFMnW2sd-6BlAMWv93bXV17j8b5MM8sHmM,580
6
- ingestr/src/sources.py,sha256=KhY6AH91zZoSthi7AbFd4_OsrPmxP3Q4ratA7ZscsZU,34810
6
+ ingestr/src/sources.py,sha256=Zw8bcAUhD_QLFNau5V768RBUhUuKhfkrV7ZXohrkaRE,34811
7
7
  ingestr/src/table_definition.py,sha256=REbAbqdlmUMUuRh8nEQRreWjPVOQ5ZcfqGkScKdCrmk,390
8
- ingestr/src/version.py,sha256=A_AARqtxTOj_AQTpjpgOxNx-UOBio5wYFfZ2mrdMKfs,23
9
- ingestr/src/adjust/__init__.py,sha256=I_G90D260OPIWCS716k0U4aeztlAieW9zi0R9-oW7TA,3007
8
+ ingestr/src/version.py,sha256=fGZMaoPHZfTX9I4TDkr07gp-kj_1U_SD-gjQC_2flQs,23
9
+ ingestr/src/adjust/__init__.py,sha256=NaRNwDhItG8Q7vUHw7zQvyfWjmT32M0CSc5ufjmBM9U,3067
10
10
  ingestr/src/adjust/adjust_helpers.py,sha256=-tmmxy9k3wms-ZEIgxmlp2cAQ2X_O1lgjY1128bbMu4,3224
11
11
  ingestr/src/airtable/__init__.py,sha256=GHWYrjI2qhs_JihdNJysB0Ni3bzqT_MLXn_S9_Q5zRA,2775
12
12
  ingestr/src/appsflyer/_init_.py,sha256=ne2-9FQ654Drtd3GkKQv8Bwb6LEqCnJw49MfO5Jyzgs,739
13
13
  ingestr/src/appsflyer/client.py,sha256=TNmwakLzmO6DZW3wcfLfQRl7aNBHgFqSsk4ef-MmJ1w,3084
14
14
  ingestr/src/arrow/__init__.py,sha256=AgU7S9Ra3ZeeG00Mf32zxO5sgMFfRnTdOSirUJ1Pu10,2976
15
- ingestr/src/chess/__init__.py,sha256=PaxT2DObudOGlhyoENE5LjR6rTdsxiqKKpAZeyzVLCA,6791
15
+ ingestr/src/chess/__init__.py,sha256=y0Q8aKBigeKf3N7wuB_gadMQjVJzBPUT8Jhp1ObEWjk,6812
16
16
  ingestr/src/chess/helpers.py,sha256=v1HTImOMjAF7AzZUPDIuHu00e7ut0o5y1kWcVYo4QZw,549
17
17
  ingestr/src/chess/settings.py,sha256=p0RlCGgtXUacPDEvZmwzSWmzX0Apj1riwfz-nrMK89k,158
18
18
  ingestr/src/facebook_ads/__init__.py,sha256=ZZyogV48gmhDcC3CYQEsC4qT3Q6JI9IOnMff2NS1M-A,9207
@@ -29,7 +29,7 @@ ingestr/src/google_sheets/helpers/api_calls.py,sha256=RiVfdacbaneszhmuhYilkJnkc9
29
29
  ingestr/src/google_sheets/helpers/data_processing.py,sha256=WYO6z4XjGcG0Hat2J2enb-eLX5mSNVb2vaqRE83FBWU,11000
30
30
  ingestr/src/gorgias/__init__.py,sha256=LZ3m6aGuhLVI3eNjvQE0rT4o_wbSPkY_SDKsM-g0V5U,21176
31
31
  ingestr/src/gorgias/helpers.py,sha256=DamuijnvhGY9hysQO4txrVMf4izkGbh5qfBKImdOINE,5427
32
- ingestr/src/hubspot/__init__.py,sha256=eSD_lEIEd16YijAtUATFG8FGO8YGPm-MtAk94KKsx6o,9740
32
+ ingestr/src/hubspot/__init__.py,sha256=LshHlFzzs8trAOxSg7C9F7zIBakqsg8XfyNBouip09w,9761
33
33
  ingestr/src/hubspot/helpers.py,sha256=PTn-UHJv1ENIvA5azUTaHCmFXgmHLJC1tUatQ1N-KFE,6727
34
34
  ingestr/src/hubspot/settings.py,sha256=9P1OKiRL88kl_m8n1HhuG-Qpq9VGbqPLn5Q0QYneToU,2193
35
35
  ingestr/src/kafka/__init__.py,sha256=wMCXdiraeKd1Kssi9WcVCGZaNGm2tJEtnNyuB4aR5_k,3541
@@ -51,12 +51,12 @@ ingestr/src/shopify/settings.py,sha256=StY0EPr7wFJ7KzRRDN4TKxV0_gkIS1wPj2eR4AYSs
51
51
  ingestr/src/slack/__init__.py,sha256=UF-ficQ6K32u1EHytW3P35suACo9wuc6nMrAPViyZL8,9981
52
52
  ingestr/src/slack/helpers.py,sha256=08TLK7vhFvH_uekdLVOLF3bTDe1zgH0QxHObXHzk1a8,6545
53
53
  ingestr/src/slack/settings.py,sha256=NhKn4y1zokEa5EmIZ05wtj_-I0GOASXZ5V81M1zXCtY,457
54
- ingestr/src/stripe_analytics/__init__.py,sha256=8yy6i4DAhUqY4ZForetQ0DWc_YQrY0FBH6yk0Z3m-Mw,4493
54
+ ingestr/src/stripe_analytics/__init__.py,sha256=VEXH4to2vNojN4rk3qsypR7urtTzaxSBB3IBiD5tuoE,4514
55
55
  ingestr/src/stripe_analytics/helpers.py,sha256=iqZOyiGIOhOAhVXXU16DP0hkkTKcTrDu69vAJoTxgEo,1976
56
56
  ingestr/src/stripe_analytics/settings.py,sha256=rl9L5XumxO0pjkZf7MGesXHp4QLRgnz3RWLuDWDBKXo,380
57
57
  ingestr/src/telemetry/event.py,sha256=MpWc5tt0lSJ1pWKe9HQ11BHrcPBxSH40l4wjZi9u0tI,924
58
58
  ingestr/src/testdata/fakebqcredentials.json,sha256=scc6TUc963KAbKTLZCfcmqVzbtzDCW1_8JNRnyAXyy8,628
59
- ingestr/src/zendesk/__init__.py,sha256=C7HkN195DGdOHId2_Sa_kAlcBrUmnVYZUa_tPkiyf1Q,17564
59
+ ingestr/src/zendesk/__init__.py,sha256=x3RNxF0kqAu81nZkg1STmb1OPhd3Gdd4-wC8gUMNLic,17563
60
60
  ingestr/src/zendesk/settings.py,sha256=Vdj706nTJFQ-3KH4nO97iYCQuba3dV3E9gfnmLK6xwU,2294
61
61
  ingestr/src/zendesk/helpers/__init__.py,sha256=YTJejCiUjfIcsj9FrkY0l-JGYDI7RRte1Ydq5FDH_0c,888
62
62
  ingestr/src/zendesk/helpers/api_helpers.py,sha256=dMkNn4ZQXgJTDOXAAXdmRt41phNFoRhYyPaLJih0pZY,4184
@@ -70,8 +70,8 @@ ingestr/testdata/delete_insert_part2.csv,sha256=B_KUzpzbNdDY_n7wWop1mT2cz36TmayS
70
70
  ingestr/testdata/merge_expected.csv,sha256=DReHqWGnQMsf2PBv_Q2pfjsgvikYFnf1zYcQZ7ZqYN0,276
71
71
  ingestr/testdata/merge_part1.csv,sha256=Pw8Z9IDKcNU0qQHx1z6BUf4rF_-SxKGFOvymCt4OY9I,185
72
72
  ingestr/testdata/merge_part2.csv,sha256=T_GiWxA81SN63_tMOIuemcvboEFeAmbKc7xRXvL9esw,287
73
- ingestr-0.10.2.dist-info/METADATA,sha256=3_ilZkg36lUCtkfUBRlI2LnVj4Vl5OKq_R8NhvKwWk4,7123
74
- ingestr-0.10.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
75
- ingestr-0.10.2.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
76
- ingestr-0.10.2.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
77
- ingestr-0.10.2.dist-info/RECORD,,
73
+ ingestr-0.10.4.dist-info/METADATA,sha256=ARKr36Ta0VKvviovDwWmDVXeGC4l4h9b3HTaNUUDpYg,7688
74
+ ingestr-0.10.4.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
75
+ ingestr-0.10.4.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
76
+ ingestr-0.10.4.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
77
+ ingestr-0.10.4.dist-info/RECORD,,