ingestr 0.13.33__py3-none-any.whl → 0.13.34__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 CHANGED
@@ -1 +1 @@
1
- version = "v0.13.33"
1
+ version = "v0.13.34"
@@ -197,11 +197,18 @@ def hubspot(
197
197
  api_key: str = api_key,
198
198
  custom_object_name: str = custom_object,
199
199
  ) -> Iterator[TDataItems]:
200
- get_custom_object = fetch_data_raw(CRM_SCHEMAS_ENDPOINT, api_key)
200
+ custom_objects = fetch_data_raw(CRM_SCHEMAS_ENDPOINT, api_key)
201
201
  object_type_id = None
202
+ associations = None
203
+ if ":" in custom_object_name:
204
+ fields = custom_object_name.split(":")
205
+ if len(fields) == 2:
206
+ custom_object_name = fields[0]
207
+ associations = fields[1]
202
208
 
203
209
  custom_object_lowercase = custom_object_name.lower()
204
- for custom_object in get_custom_object["results"]:
210
+
211
+ for custom_object in custom_objects["results"]:
205
212
  if custom_object["name"].lower() == custom_object_lowercase:
206
213
  object_type_id = custom_object["objectTypeId"]
207
214
  break
@@ -223,6 +230,8 @@ def hubspot(
223
230
  props = ",".join(sorted(list(set(props))))
224
231
 
225
232
  custom_object_endpoint = f"crm/v3/objects/{object_type_id}/?properties={props}"
233
+ if associations:
234
+ custom_object_endpoint += f"&associations={associations}"
226
235
 
227
236
  """Hubspot custom object details resource"""
228
237
  yield from fetch_data(custom_object_endpoint, api_key, resource_name="custom")
@@ -148,10 +148,6 @@ def fetch_data(
148
148
  "updatedAt": _result.get("updatedAt", ""),
149
149
  }
150
150
  )
151
- elif resource_name == "custom":
152
- _objects.append(
153
- _result.get("properties", ""),
154
- )
155
151
  else:
156
152
  _obj = _result.get("properties", _result)
157
153
  if "id" not in _obj and "id" in _result:
ingestr/src/sources.py CHANGED
@@ -722,7 +722,7 @@ class FacebookAdsSource:
722
722
  ).with_resources("facebook_insights")
723
723
  else:
724
724
  raise ValueError(
725
- "fResource '{table}' is not supported for Facebook Ads source yet, if you are interested in it please create a GitHub issue at https://github.com/bruin-data/ingestr"
725
+ f"Resource '{table}' is not supported for Facebook Ads source yet, if you are interested in it please create a GitHub issue at https://github.com/bruin-data/ingestr"
726
726
  )
727
727
 
728
728
  return facebook_ads_source(
@@ -804,11 +804,16 @@ class HubspotSource:
804
804
 
805
805
  if table.startswith("custom:"):
806
806
  fields = table.split(":", 2)
807
- if len(fields) != 2:
807
+ if len(fields) != 2 and len(fields) != 3:
808
808
  raise ValueError(
809
- "Invalid Hubspot custom table format. Expected format: custom:<custom_object_type>"
809
+ "Invalid Hubspot custom table format. Expected format: custom:<custom_object_type> or custom:<custom_object_type>:<associations>"
810
810
  )
811
- endpoint = fields[1]
811
+
812
+ if len(fields) == 2:
813
+ endpoint = fields[1]
814
+ else:
815
+ endpoint = f"{fields[1]}:{fields[2]}"
816
+
812
817
  return hubspot(
813
818
  api_key=api_key[0],
814
819
  custom_object=endpoint,
@@ -1175,7 +1180,7 @@ class ZendeskSource:
1175
1180
  ).with_resources(table)
1176
1181
  else:
1177
1182
  raise ValueError(
1178
- "fResource '{table}' is not supported for Zendesk source yet, if you are interested in it please create a GitHub issue at https://github.com/bruin-data/ingestr"
1183
+ f"Resource '{table}' is not supported for Zendesk source yet, if you are interested in it please create a GitHub issue at https://github.com/bruin-data/ingestr"
1179
1184
  )
1180
1185
 
1181
1186
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ingestr
3
- Version: 0.13.33
3
+ Version: 0.13.34
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=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=0FHynPZSrkbfDnEUgBysgvemGcO2crTfn654je6lyHY,21
5
+ ingestr/src/buildinfo.py,sha256=i3Tz80qXUH6VzMC8jzlySZd05zyoaaBcvoyLd2q-wKg,21
6
6
  ingestr/src/destinations.py,sha256=0fEwLY78SQDXbHcX4iz4Xc7H8FXN-QhVJL9uoUTZOs4,12924
7
7
  ingestr/src/errors.py,sha256=Ufs4_DfE77_E3vnA1fOQdi6cmuLVNm7_SbFLkL1XPGk,686
8
8
  ingestr/src/factory.py,sha256=659h_sVRBhtPv2dvtOK8tf3PtUhlK3KsWLrb20_iQKw,5333
@@ -10,7 +10,7 @@ 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=JiSqOyuvun0T3JQriYDmp_8EPe_2cepwo0wWtI-jOrU,76003
13
+ ingestr/src/sources.py,sha256=uRERygJ41y0MNXF3-FJvHr4btxlEM93ZeWr_Liz3N2M,76181
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
@@ -62,8 +62,8 @@ ingestr/src/google_sheets/helpers/api_calls.py,sha256=RiVfdacbaneszhmuhYilkJnkc9
62
62
  ingestr/src/google_sheets/helpers/data_processing.py,sha256=RNt2MYfdJhk4bRahnQVezpNg2x9z0vx60YFq2ukZ8vI,11004
63
63
  ingestr/src/gorgias/__init__.py,sha256=_mFkMYwlY5OKEY0o_FK1OKol03A-8uk7bm1cKlmt5cs,21432
64
64
  ingestr/src/gorgias/helpers.py,sha256=DamuijnvhGY9hysQO4txrVMf4izkGbh5qfBKImdOINE,5427
65
- ingestr/src/hubspot/__init__.py,sha256=QheZb_F2TEBdzd29SEgkU3AMdIIF7Gpj-t27EXnSIZ4,11448
66
- ingestr/src/hubspot/helpers.py,sha256=4aVOSzIsQV3RemqRJEJLu7BWMdcOuubwNvrjuMu87rg,8045
65
+ ingestr/src/hubspot/__init__.py,sha256=wqHefhc_YRI5dNFCcpvH-UUilNThE49sbGouSBiHYsw,11776
66
+ ingestr/src/hubspot/helpers.py,sha256=k2b-lhxqBNKHoOSHoHegFSsk8xxjjGA0I04V0XyX2b4,7883
67
67
  ingestr/src/hubspot/settings.py,sha256=i73MkSiJfRLMFLfiJgYdhp-rhymHTfoqFzZ4uOJdFJM,2456
68
68
  ingestr/src/kafka/__init__.py,sha256=wMCXdiraeKd1Kssi9WcVCGZaNGm2tJEtnNyuB4aR5_k,3541
69
69
  ingestr/src/kafka/helpers.py,sha256=V9WcVn3PKnEpggArHda4vnAcaV8VDuh__dSmRviJb5Y,7502
@@ -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.33.dist-info/METADATA,sha256=EZJ3I_1bEu7BeaeNBzWKNePpaLkw56jWoPiJBSUJF_Y,13574
126
- ingestr-0.13.33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
127
- ingestr-0.13.33.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
128
- ingestr-0.13.33.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
129
- ingestr-0.13.33.dist-info/RECORD,,
125
+ ingestr-0.13.34.dist-info/METADATA,sha256=84NPfN9LSTGrw79p3116CXH9BZGjnXgEvglsXpVhEY0,13574
126
+ ingestr-0.13.34.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
127
+ ingestr-0.13.34.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
128
+ ingestr-0.13.34.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
129
+ ingestr-0.13.34.dist-info/RECORD,,