Skip to content

Commit e261563

Browse files
authored
Merge pull request #3818 from SFDO-Tooling/feature/select_records
@W-16485311: Core Logic for Selecting Records from Target Org
2 parents abe92e7 + 8a984fd commit e261563

25 files changed

Lines changed: 5443 additions & 253 deletions

cumulusci/core/tests/test_datasets_e2e.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ def write_yaml(filename: str, json: Any):
304304
"after": "Insert Account",
305305
}
306306
},
307+
"select_options": {},
307308
},
308309
"Insert Event": {
309310
"sf_object": "Event",
@@ -316,16 +317,19 @@ def write_yaml(filename: str, json: Any):
316317
"after": "Insert Lead",
317318
}
318319
},
320+
"select_options": {},
319321
},
320322
"Insert Account": {
321323
"sf_object": "Account",
322324
"table": "Account",
323325
"fields": ["Name"],
326+
"select_options": {},
324327
},
325328
"Insert Lead": {
326329
"sf_object": "Lead",
327330
"table": "Lead",
328331
"fields": ["Company", "LastName"],
332+
"select_options": {},
329333
},
330334
}
331335
assert tuple(actual.items()) == tuple(expected.items()), actual.items()

cumulusci/tasks/bulkdata/extract_dataset_utils/extract_yml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pydantic import Field, validator
66

77
from cumulusci.core.enums import StrEnum
8-
from cumulusci.tasks.bulkdata.step import DataApi
8+
from cumulusci.tasks.bulkdata.utils import DataApi
99
from cumulusci.utils.yaml.model_parser import CCIDictModel, HashableBaseModel
1010

1111
object_decl = re.compile(r"objects\((\w+)\)", re.IGNORECASE)

cumulusci/tasks/bulkdata/generate_mapping_utils/tests/test_generate_load_mapping_from_declarations.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def test_simple_generate_mapping_from_declarations(self, org_config):
4141
"sf_object": "Account",
4242
"table": "Account",
4343
"fields": ["Name", "Description"],
44+
"select_options": {},
4445
}
4546
}
4647

@@ -74,11 +75,13 @@ def test_generate_mapping_from_both_kinds_of_declarations(self, org_config):
7475
"sf_object": "Contact",
7576
"table": "Contact",
7677
"fields": ["FirstName", "LastName"],
78+
"select_options": {},
7779
},
7880
"Insert Account": {
7981
"sf_object": "Account",
8082
"table": "Account",
8183
"fields": ["Name", "Description"],
84+
"select_options": {},
8285
},
8386
}.items()
8487
)
@@ -111,6 +114,7 @@ def test_generate_load_mapping_from_declarations__lookups(self, org_config):
111114
"sf_object": "Account",
112115
"table": "Account",
113116
"fields": ["Name", "Description"],
117+
"select_options": {},
114118
},
115119
"Insert Contact": {
116120
"sf_object": "Contact",
@@ -119,6 +123,7 @@ def test_generate_load_mapping_from_declarations__lookups(self, org_config):
119123
"lookups": {
120124
"AccountId": {"table": ["Account"], "key_field": "AccountId"}
121125
},
126+
"select_options": {},
122127
},
123128
}
124129

@@ -157,6 +162,7 @@ def test_generate_load_mapping_from_declarations__polymorphic_lookups(
157162
"sf_object": "Account",
158163
"table": "Account",
159164
"fields": ["Name", "Description"],
165+
"select_options": {},
160166
},
161167
"Insert Contact": {
162168
"sf_object": "Contact",
@@ -165,11 +171,13 @@ def test_generate_load_mapping_from_declarations__polymorphic_lookups(
165171
"lookups": {
166172
"AccountId": {"table": ["Account"], "key_field": "AccountId"}
167173
},
174+
"select_options": {},
168175
},
169176
"Insert Lead": {
170177
"sf_object": "Lead",
171178
"table": "Lead",
172179
"fields": ["LastName", "Company"],
180+
"select_options": {},
173181
},
174182
"Insert Event": {
175183
"sf_object": "Event",
@@ -178,6 +186,7 @@ def test_generate_load_mapping_from_declarations__polymorphic_lookups(
178186
"lookups": {
179187
"WhoId": {"table": ["Contact", "Lead"], "key_field": "WhoId"}
180188
},
189+
"select_options": {},
181190
},
182191
}
183192

@@ -221,6 +230,7 @@ def test_generate_load_mapping_from_declarations__circular_lookups(
221230
},
222231
"sf_object": "Account",
223232
"table": "Account",
233+
"select_options": {},
224234
},
225235
"Insert Contact": {
226236
"sf_object": "Contact",
@@ -229,6 +239,7 @@ def test_generate_load_mapping_from_declarations__circular_lookups(
229239
"lookups": {
230240
"AccountId": {"table": ["Account"], "key_field": "AccountId"}
231241
},
242+
"select_options": {},
232243
},
233244
}, mf
234245

@@ -252,11 +263,13 @@ def test_generate_load_mapping__with_load_declarations(self, org_config):
252263
"sf_object": "Account",
253264
"api": DataApi.REST,
254265
"table": "Account",
266+
"select_options": {},
255267
},
256268
"Insert Contact": {
257269
"sf_object": "Contact",
258270
"api": DataApi.BULK,
259271
"table": "Contact",
272+
"select_options": {},
260273
},
261274
}, mf
262275

@@ -288,24 +301,28 @@ def test_generate_load_mapping__with_upserts(self, org_config):
288301
"Insert Account": {
289302
"sf_object": "Account",
290303
"table": "Account",
304+
"select_options": {},
291305
},
292306
"Upsert Account Name": {
293307
"sf_object": "Account",
294308
"table": "Account",
295309
"action": DataOperationType.UPSERT,
296310
"update_key": ("Name",),
297311
"fields": ["Name"],
312+
"select_options": {},
298313
},
299314
"Etl_Upsert Account AccountNumber_Name": {
300315
"sf_object": "Account",
301316
"table": "Account",
302317
"action": DataOperationType.ETL_UPSERT,
303318
"update_key": ("AccountNumber", "Name"),
304319
"fields": ["AccountNumber", "Name"],
320+
"select_options": {},
305321
},
306322
"Insert Contact": {
307323
"sf_object": "Contact",
308324
"table": "Contact",
325+
"select_options": {},
309326
},
310327
}, mf
311328

0 commit comments

Comments
 (0)