ingestr 0.13.89__py3-none-any.whl → 0.13.91__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/salesforce/__init__.py +6 -0
- ingestr/src/smartsheets/__init__.py +1 -1
- ingestr/src/sources.py +6 -1
- ingestr/tests/unit/test_smartsheets.py +4 -4
- {ingestr-0.13.89.dist-info → ingestr-0.13.91.dist-info}/METADATA +1 -1
- {ingestr-0.13.89.dist-info → ingestr-0.13.91.dist-info}/RECORD +10 -10
- {ingestr-0.13.89.dist-info → ingestr-0.13.91.dist-info}/WHEEL +0 -0
- {ingestr-0.13.89.dist-info → ingestr-0.13.91.dist-info}/entry_points.txt +0 -0
- {ingestr-0.13.89.dist-info → ingestr-0.13.91.dist-info}/licenses/LICENSE.md +0 -0
ingestr/src/buildinfo.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "v0.13.
|
|
1
|
+
version = "v0.13.91"
|
|
@@ -14,6 +14,7 @@ def salesforce_source(
|
|
|
14
14
|
password: str,
|
|
15
15
|
token: str,
|
|
16
16
|
domain: str,
|
|
17
|
+
custom_object: str = None,
|
|
17
18
|
) -> Iterable[DltResource]:
|
|
18
19
|
"""
|
|
19
20
|
Retrieves data from Salesforce using the Salesforce API.
|
|
@@ -131,6 +132,10 @@ def salesforce_source(
|
|
|
131
132
|
) -> Iterable[TDataItem]:
|
|
132
133
|
yield get_records(client, "Event", last_timestamp.last_value, "SystemModstamp")
|
|
133
134
|
|
|
135
|
+
@dlt.resource(write_disposition="replace")
|
|
136
|
+
def custom() -> Iterable[TDataItem]:
|
|
137
|
+
yield get_records(client, custom_object)
|
|
138
|
+
|
|
134
139
|
return (
|
|
135
140
|
user,
|
|
136
141
|
user_role,
|
|
@@ -147,4 +152,5 @@ def salesforce_source(
|
|
|
147
152
|
pricebook_entry,
|
|
148
153
|
task,
|
|
149
154
|
event,
|
|
155
|
+
custom,
|
|
150
156
|
)
|
|
@@ -48,7 +48,7 @@ def _get_sheet_data(smartsheet_client: smartsheet.Smartsheet, sheet_id: int):
|
|
|
48
48
|
# Transform rows to a list of dictionaries
|
|
49
49
|
column_titles = [col.title for col in sheet.columns]
|
|
50
50
|
for row in sheet.rows:
|
|
51
|
-
row_data = {}
|
|
51
|
+
row_data = {"_row_id": row.id}
|
|
52
52
|
for i, cell in enumerate(row.cells):
|
|
53
53
|
row_data[column_titles[i]] = cell.value
|
|
54
54
|
yield row_data
|
ingestr/src/sources.py
CHANGED
|
@@ -2525,9 +2525,14 @@ class SalesforceSource:
|
|
|
2525
2525
|
|
|
2526
2526
|
src = salesforce_source(**creds) # type: ignore
|
|
2527
2527
|
|
|
2528
|
+
if table.startswith("custom:"):
|
|
2529
|
+
custom_object = table.split(":")[1]
|
|
2530
|
+
src = salesforce_source(**creds, custom_object=custom_object)
|
|
2531
|
+
return src.with_resources("custom")
|
|
2532
|
+
|
|
2528
2533
|
if table not in src.resources:
|
|
2529
2534
|
raise UnsupportedResourceError(table, "Salesforce")
|
|
2530
|
-
|
|
2535
|
+
|
|
2531
2536
|
return src.with_resources(table)
|
|
2532
2537
|
|
|
2533
2538
|
|
|
@@ -60,8 +60,8 @@ class TestSmartsheetSource(unittest.TestCase):
|
|
|
60
60
|
resource = smartsheet_source(access_token="test_token", sheet_id="123")
|
|
61
61
|
data = list(resource)
|
|
62
62
|
self.assertEqual(len(data), 2)
|
|
63
|
-
self.assertEqual(data[0], {"Col A": "r1c1", "Col B": "r1c2"})
|
|
64
|
-
self.assertEqual(data[1], {"Col A": "r2c1", "Col B": "r2c2"})
|
|
63
|
+
self.assertEqual(data[0], {"_row_id": 101, "Col A": "r1c1", "Col B": "r1c2"})
|
|
64
|
+
self.assertEqual(data[1], {"_row_id": 102, "Col A": "r2c1", "Col B": "r2c2"})
|
|
65
65
|
|
|
66
66
|
mock_smartsheet_client.assert_called_once_with("test_token")
|
|
67
67
|
mock_client_instance.Sheets.get_sheet.assert_any_call(
|
|
@@ -127,8 +127,8 @@ class TestSmartsheetSource(unittest.TestCase):
|
|
|
127
127
|
data = list(data_generator)
|
|
128
128
|
|
|
129
129
|
self.assertEqual(len(data), 2)
|
|
130
|
-
self.assertEqual(data[0], {"ID": 1, "Value": "Alpha"})
|
|
131
|
-
self.assertEqual(data[1], {"ID": 2, "Value": "Beta"})
|
|
130
|
+
self.assertEqual(data[0], {"_row_id": 201, "ID": 1, "Value": "Alpha"})
|
|
131
|
+
self.assertEqual(data[1], {"_row_id": 202, "ID": 2, "Value": "Beta"})
|
|
132
132
|
mock_smartsheet_client_instance.Sheets.get_sheet.assert_called_once_with(456)
|
|
133
133
|
|
|
134
134
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ingestr
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.91
|
|
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=qo0g3wCFl8a_1jUwXagX8L1Q8PKKQlTF7md9pfnzW0Y,27155
|
|
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=Z02M6HWq5e5pQblQqGTU2e_cyTSWgBjYZEoGMT8xfX8,21
|
|
6
6
|
ingestr/src/destinations.py,sha256=QNT2rm91cZmY1_Zyj4VnbI14qGmZOUQOQUg9xUTVVYs,23799
|
|
7
7
|
ingestr/src/errors.py,sha256=Ufs4_DfE77_E3vnA1fOQdi6cmuLVNm7_SbFLkL1XPGk,686
|
|
8
8
|
ingestr/src/factory.py,sha256=hC5E_XgrgTHMqwqPc6ihUYvRGTGMTzdPfQhrgPyD0tY,6945
|
|
@@ -12,7 +12,7 @@ ingestr/src/loader.py,sha256=9NaWAyfkXdqAZSS-N72Iwo36Lbx4PyqIfaaH1dNdkFs,1712
|
|
|
12
12
|
ingestr/src/masking.py,sha256=VN0LdfvExhQ1bZMRylGtaBUIoH-vjuIUmRnYKwo3yiY,11358
|
|
13
13
|
ingestr/src/partition.py,sha256=BrIP6wFJvyR7Nus_3ElnfxknUXeCipK_E_bB8kZowfc,969
|
|
14
14
|
ingestr/src/resource.py,sha256=ZqmZxFQVGlF8rFPhBiUB08HES0yoTj8sZ--jKfaaVps,1164
|
|
15
|
-
ingestr/src/sources.py,sha256=
|
|
15
|
+
ingestr/src/sources.py,sha256=E_btMZLfZR0Ry885FZ8SYADy-iV8dX0G3jSXfSZgnpE,125395
|
|
16
16
|
ingestr/src/table_definition.py,sha256=REbAbqdlmUMUuRh8nEQRreWjPVOQ5ZcfqGkScKdCrmk,390
|
|
17
17
|
ingestr/src/time.py,sha256=H_Fk2J4ShXyUM-EMY7MqCLZQhlnZMZvO952bmZPc4yE,254
|
|
18
18
|
ingestr/src/version.py,sha256=J_2xgZ0mKlvuHcjdKCx2nlioneLH0I47JiU_Slr_Nwc,189
|
|
@@ -116,7 +116,7 @@ ingestr/src/pipedrive/helpers/pages.py,sha256=Klpjw2OnMuhzit3PpiHKsfzGcJ3rQPSQBl
|
|
|
116
116
|
ingestr/src/quickbooks/__init__.py,sha256=cZUuVCOTGPHTscRj6i0DytO63_fWF-4ieMxoU4PcyTg,3727
|
|
117
117
|
ingestr/src/revenuecat/__init__.py,sha256=5HbyZuEOekkbeeT72sM_bnGygSyYdmd_vczfAUz7xoM,4029
|
|
118
118
|
ingestr/src/revenuecat/helpers.py,sha256=CYU6l79kplnfL87GfdxyGeEBrBSWEZfGP0GyjPHuVDk,9619
|
|
119
|
-
ingestr/src/salesforce/__init__.py,sha256=
|
|
119
|
+
ingestr/src/salesforce/__init__.py,sha256=Ijveo8gyo_wLzQRBklxIm3RV0y2Gta9-mR44RbJljpI,4901
|
|
120
120
|
ingestr/src/salesforce/helpers.py,sha256=QTdazBt-qRTBbCQMZnyclIaDQFmBixBy_RDKD00Lt-8,2492
|
|
121
121
|
ingestr/src/shopify/__init__.py,sha256=RzSSG93g-Qlkz6TAxi1XasFDdxxtVXIo53ZTtjGczW4,62602
|
|
122
122
|
ingestr/src/shopify/exceptions.py,sha256=BhV3lIVWeBt8Eh4CWGW_REFJpGCzvW6-62yZrBWa3nQ,50
|
|
@@ -125,7 +125,7 @@ ingestr/src/shopify/settings.py,sha256=StY0EPr7wFJ7KzRRDN4TKxV0_gkIS1wPj2eR4AYSs
|
|
|
125
125
|
ingestr/src/slack/__init__.py,sha256=pyDukxcilqTAe_bBzfWJ8Vxi83S-XEdEFBH2pEgILrM,10113
|
|
126
126
|
ingestr/src/slack/helpers.py,sha256=08TLK7vhFvH_uekdLVOLF3bTDe1zgH0QxHObXHzk1a8,6545
|
|
127
127
|
ingestr/src/slack/settings.py,sha256=NhKn4y1zokEa5EmIZ05wtj_-I0GOASXZ5V81M1zXCtY,457
|
|
128
|
-
ingestr/src/smartsheets/__init__.py,sha256=
|
|
128
|
+
ingestr/src/smartsheets/__init__.py,sha256=3_Kz3AW68UhRg8WvppOeIcQYw04XlyrIHLx2A2pCx-o,1640
|
|
129
129
|
ingestr/src/solidgate/__init__.py,sha256=Ts83j-JSnFsFuF4tDhVOfZKg7H0-bIpfn3kg1ZOR58A,8003
|
|
130
130
|
ingestr/src/solidgate/helpers.py,sha256=mAsW_1hpD7ab3Y2vw8fxHi4yD3aT1geLdIYZ7ycyxBc,5690
|
|
131
131
|
ingestr/src/sql_database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -157,9 +157,9 @@ ingestr/testdata/delete_insert_part2.csv,sha256=B_KUzpzbNdDY_n7wWop1mT2cz36TmayS
|
|
|
157
157
|
ingestr/testdata/merge_expected.csv,sha256=DReHqWGnQMsf2PBv_Q2pfjsgvikYFnf1zYcQZ7ZqYN0,276
|
|
158
158
|
ingestr/testdata/merge_part1.csv,sha256=Pw8Z9IDKcNU0qQHx1z6BUf4rF_-SxKGFOvymCt4OY9I,185
|
|
159
159
|
ingestr/testdata/merge_part2.csv,sha256=T_GiWxA81SN63_tMOIuemcvboEFeAmbKc7xRXvL9esw,287
|
|
160
|
-
ingestr/tests/unit/test_smartsheets.py,sha256=
|
|
161
|
-
ingestr-0.13.
|
|
162
|
-
ingestr-0.13.
|
|
163
|
-
ingestr-0.13.
|
|
164
|
-
ingestr-0.13.
|
|
165
|
-
ingestr-0.13.
|
|
160
|
+
ingestr/tests/unit/test_smartsheets.py,sha256=i9diA7mXXwQLKGTcalD89OEDx8rqZi8pxtcE23ncgRQ,5122
|
|
161
|
+
ingestr-0.13.91.dist-info/METADATA,sha256=uqF78vk-mLjG7WPnDZJi1bFVeKR5bKgLNKv7sqDzekc,15182
|
|
162
|
+
ingestr-0.13.91.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
163
|
+
ingestr-0.13.91.dist-info/entry_points.txt,sha256=oPJy0KBnPWYjDtP1k8qwAihcTLHSZokSQvRAw_wtfJM,46
|
|
164
|
+
ingestr-0.13.91.dist-info/licenses/LICENSE.md,sha256=cW8wIhn8HFE-KLStDF9jHQ1O_ARWP3kTpk_-eOccL24,1075
|
|
165
|
+
ingestr-0.13.91.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|