Repository: SFDO-Tooling/CumulusCI
Pull request #3552 (2023-03-02 21:23:11)

Fix an issue with `capture_sample_data` and record type capturing.
Record types were being extracted explicitly by the mapping file 
generator in addition to the magic record type handling. Now, the 
auto-extract does not treat record type ID fields as lookups but rather 
as plain text.



Patch:
diff --git a/cumulusci/salesforce_api/filterable_objects.py b/cumulusci/salesforce_api/filterable_objects.py
index b72a8df9c..810307549 100644
--- a/cumulusci/salesforce_api/filterable_objects.py
+++ b/cumulusci/salesforce_api/filterable_objects.py
@@ -34,6 +34,7 @@ NOT_EXTRACTABLE = NOT_COUNTABLE + (
     "PermissionSetLicenseAssign",
     "PermissionSetTabSetting",
     "Profile",
+    "RecordType",
     "User",
     "UserAppInfo",
     "UserAppMenuCustomization",
diff --git a/cumulusci/tasks/bulkdata/extract_dataset_utils/calculate_dependencies.py b/cumulusci/tasks/bulkdata/extract_dataset_utils/calculate_dependencies.py
index dc65b2c80..19162e35b 100644
--- a/cumulusci/tasks/bulkdata/extract_dataset_utils/calculate_dependencies.py
+++ b/cumulusci/tasks/bulkdata/extract_dataset_utils/calculate_dependencies.py
@@ -26,6 +26,7 @@ def _calculate_dependencies_for_declarations(
     """
     dependencies = {}
     for decl in decls:
+        assert isinstance(decl.sf_object, str)
         new_dependencies = _collect_dependencies_for_sobject(
             decl.sf_object, decl.fields, schema, only_required_fields=False
         )
@@ -38,7 +39,7 @@ def _collect_dependencies_for_sobject(
     fields: T.List[str],
     schema: Schema,
     only_required_fields: bool,
-):
+) -> T.Dict[str, T.List[SObjDependency]]:
     """Ensure that required lookups are fulfilled for a single SObject
 
     Do this by adding its referent tables (in full) to the extract.
@@ -50,7 +51,7 @@ def _collect_dependencies_for_sobject(
         if not field_info.createable:  # pragma: no cover
             continue
         references = field_info.referenceTo
-        if len(references) == 1:
+        if len(references) == 1 and not references[0] == "RecordType":
             target = references[0]
 
             target_disallowed = target in NOT_EXTRACTABLE
diff --git a/cumulusci/tasks/bulkdata/generate_mapping_utils/generate_mapping_from_declarations.py b/cumulusci/tasks/bulkdata/generate_mapping_utils/generate_mapping_from_declarations.py
index f7ccac0ed..8e7d74136 100644
--- a/cumulusci/tasks/bulkdata/generate_mapping_utils/generate_mapping_from_declarations.py
+++ b/cumulusci/tasks/bulkdata/generate_mapping_utils/generate_mapping_from_declarations.py
@@ -33,13 +33,13 @@ def create_load_mapping_file_from_extract_declarations(
         fields = tuple(chain(decl.fields, decl.lookups.keys()))
         return MappingStep(
             sf_object=decl.sf_object,
-            fields=zip(fields, fields),
+            fields=dict(zip(fields, fields)),
             # lookups=lookups,      # lookups can be re-created later, for simplicity
         )
 
     mapping_steps = [_mapping_step(decl) for decl in simplified_decls_w_lookups]
 
-    mappings = generate_load_mapping_file(mapping_steps, intertable_dependencies, None)
+    mappings = generate_load_mapping_file(mapping_steps, intertable_dependencies, [])
     return mappings
 
 
@@ -60,7 +60,8 @@ def classify_and_filter_lookups(
     decls: T.Sequence[SimplifiedExtractDeclaration], schema: Schema
 ) -> T.Sequence[SimplifiedExtractDeclarationWithLookups]:
     """Move lookups into their own field, if they reference a table we're including"""
-    referenceable_tables = [decl.sf_object for decl in decls]
+    referenceable_tables = [decl.sf_object for decl in decls if decl.sf_object]
+    # the if statement above is just to shut up the type checker
     return [_add_lookups_to_decl(decl, schema, referenceable_tables) for decl in decls]
 
 
@@ -87,10 +88,16 @@ def _add_lookups_to_decl(
 
 def _fields_and_lookups_for_decl(decl, sobject_schema_info, referenceable_tables):
     """Split fields versus lookups for a declaration"""
-    simple_fields, lookups = partition(
-        lambda field_name: sobject_schema_info.fields[field_name].referenceTo,
-        decl.fields,
-    )
+
+    def is_lookup(field_name):
+        # Record types are not treated as lookup.
+        if field_name == "RecordTypeId":
+            return False
+        schema_info_for_field = sobject_schema_info.fields[field_name]
+        target = schema_info_for_field.referenceTo
+        return target
+
+    simple_fields, lookups = partition(is_lookup, decl.fields)
 
     def target_table(field_info):
         if len(field_info.referenceTo) == 1:
diff --git a/pyproject.toml b/pyproject.toml
index f842702c0..ebceeafca 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -205,8 +205,10 @@ include = [
     'cumulusci/tasks/apex/__init__.py',
     'cumulusci/tasks/bulkdata/__init__.py',
     'cumulusci/tasks/bulkdata/dates.py',
+    'cumulusci/tasks/bulkdata/extract_dataset_utils/calculate_dependencies.py',
     'cumulusci/tasks/bulkdata/generate.py',
     'cumulusci/tasks/bulkdata/generate_and_load_data_from_yaml.py',
+    'cumulusci/tasks/bulkdata/generate_mapping_utils/generate_mapping_from_declarations.py',
     'cumulusci/tasks/bulkdata/generate_mapping_utils/mapping_generator_post_processes.py',
     'cumulusci/tasks/bulkdata/query_transformers.py',
     'cumulusci/tasks/bulkdata/snowfakery_utils/snowfakery_working_directory.py',


Test patch:
diff --git a/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_e2e.yaml b/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_e2e.yaml
index 42cdb269e..5833b12d3 100644
--- a/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_e2e.yaml
+++ b/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_e2e.yaml
@@ -1,7 +1,7 @@
 version: 1
 interactions:
     - &id009
-      request: &id005
+      request: &id004
           method: GET
           uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=select+count%28Id%29+from+Account
           body: null
@@ -20,10 +20,9 @@ interactions:
               string: "{\n  \"totalSize\" : 1,\n  \"done\" : true,\n  \"records\" : [ {\n\
                   \    \"attributes\" : {\n      \"type\" : \"AggregateResult\"\n    },\n  \
                   \  \"expr0\" : 6\n  } ]\n}"
-    - &id006
+    - &id005
       include_file: GET_sobjects_Organization.yaml
-    - &id004
-      request:
+    - request:
           method: GET
           uri: https://orgname.my.salesforce.com/services/data/vxx.0/limits/recordCount?sObjects=Account
           body: null
@@ -37,7 +36,7 @@ interactions:
                   \n  } ]\n}"
     - request:
           method: GET
-          uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=SELECT+Id%2C+AccountNumber%2C+AccountSource%2C+AnnualRevenue%2C+BillingCity%2C+BillingCountry%2C+BillingGeocodeAccuracy%2C+BillingLatitude%2C+BillingLongitude%2C+BillingPostalCode%2C+BillingState%2C+BillingStreet%2C+CleanStatus%2C+DunsNumber%2C+Fax%2C+Industry%2C+Jigsaw%2C+NaicsCode%2C+NaicsDesc%2C+Name%2C+NumberOfEmployees%2C+Ownership%2C+Phone%2C+Rating%2C+ShippingCity%2C+ShippingCountry%2C+ShippingGeocodeAccuracy%2C+ShippingLatitude%2C+ShippingLongitude%2C+ShippingPostalCode%2C+ShippingState%2C+ShippingStreet%2C+Sic%2C+SicDesc%2C+Site%2C+TickerSymbol%2C+Tradestyle%2C+Type%2C+Website%2C+YearStarted%2C+ParentId+FROM+Account+WHERE+Name+%21%3D+%27Sample+Account+for+Entitlements%27
+          uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=SELECT+Id%2C+AccountNumber%2C+AccountSource%2C+AnnualRevenue%2C+BillingCity%2C+BillingCountry%2C+BillingGeocodeAccuracy%2C+BillingLatitude%2C+BillingLongitude%2C+BillingPostalCode%2C+BillingState%2C+BillingStreet%2C+CleanStatus%2C+DunsNumber%2C+Fax%2C+Industry%2C+Jigsaw%2C+NaicsCode%2C+NaicsDesc%2C+Name%2C+NumberOfEmployees%2C+Ownership%2C+Phone%2C+Rating%2C+RecordTypeId%2C+ShippingCity%2C+ShippingCountry%2C+ShippingGeocodeAccuracy%2C+ShippingLatitude%2C+ShippingLongitude%2C+ShippingPostalCode%2C+ShippingState%2C+ShippingStreet%2C+Sic%2C+SicDesc%2C+Site%2C+TickerSymbol%2C+Tradestyle%2C+Type%2C+Website%2C+YearStarted%2C+ParentId+FROM+Account+WHERE+Name+%21%3D+%27Sample+Account+for+Entitlements%27
           body: null
           headers: *id001
       response:
@@ -46,8 +45,8 @@ interactions:
           body:
               string: "{\n  \"totalSize\" : 6,\n  \"done\" : true,\n  \"records\" : [ {\n\
                   \    \"attributes\" : {\n      \"type\" : \"Account\",\n      \"url\" : \"\
-                  /services/data/vxx.0/sobjects/Account/0018D00000H55iKQAR\"\n    },\n    \"\
-                  Id\" : \"0018D00000H55iKQAR\",\n    \"AccountNumber\" : null,\n    \"AccountSource\"\
+                  /services/data/vxx.0/sobjects/Account/001Da00000xnAk6IAE\"\n    },\n    \"\
+                  Id\" : \"001Da00000xnAk6IAE\",\n    \"AccountNumber\" : null,\n    \"AccountSource\"\
                   \ : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\" : null,\n  \
                   \  \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\" : null,\n  \
                   \  \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n    \"BillingPostalCode\"\
@@ -56,16 +55,16 @@ interactions:
                   \ : null,\n    \"Industry\" : null,\n    \"Jigsaw\" : null,\n    \"NaicsCode\"\
                   \ : null,\n    \"NaicsDesc\" : null,\n    \"Name\" : \"Account 5\",\n    \"\
                   NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n    \"Phone\" : null,\n\
-                  \    \"Rating\" : null,\n    \"ShippingCity\" : null,\n    \"ShippingCountry\"\
-                  \ : null,\n    \"ShippingGeocodeAccuracy\" : null,\n    \"ShippingLatitude\"\
-                  \ : null,\n    \"ShippingLongitude\" : null,\n    \"ShippingPostalCode\" :\
-                  \ null,\n    \"ShippingState\" : null,\n    \"ShippingStreet\" : null,\n \
-                  \   \"Sic\" : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n    \"\
-                  TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n    \"Type\" : null,\n\
-                  \    \"Website\" : null,\n    \"YearStarted\" : null,\n    \"ParentId\" :\
-                  \ null\n  }, {\n    \"attributes\" : {\n      \"type\" : \"Account\",\n  \
-                  \    \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55iAQAR\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55iAQAR\",\n    \"AccountNumber\" : null,\n\
+                  \    \"Rating\" : null,\n    \"RecordTypeId\" : null,\n    \"ShippingCity\"\
+                  \ : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
+                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
+                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
+                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
+                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
+                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
+                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
+                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/001Da00000xnAjrIAE\"\
+                  \n    },\n    \"Id\" : \"001Da00000xnAjrIAE\",\n    \"AccountNumber\" : null,\n\
                   \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
                   \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
                   \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
@@ -73,17 +72,17 @@ interactions:
                   \ : null,\n    \"CleanStatus\" : \"Pending\",\n    \"DunsNumber\" : null,\n\
                   \    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" : null,\n \
                   \   \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\" : \"Account\
-                  \ 3\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n   \
-                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"ShippingCity\" : null,\n\
-                  \    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\" : null,\n\
-                  \    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n   \
-                  \ \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"ShippingStreet\"\
-                  \ : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n\
-                  \    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n    \"Type\" :\
-                  \ null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n    \"ParentId\"\
-                  \ : null\n  }, {\n    \"attributes\" : {\n      \"type\" : \"Account\",\n\
-                  \      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55hqQAB\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55hqQAB\",\n    \"AccountNumber\" : null,\n\
+                  \ 1\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n   \
+                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\" : null,\n\
+                  \    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
+                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
+                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
+                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
+                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
+                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
+                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
+                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/001Da00000xnAk1IAE\"\
+                  \n    },\n    \"Id\" : \"001Da00000xnAk1IAE\",\n    \"AccountNumber\" : null,\n\
                   \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
                   \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
                   \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
@@ -91,17 +90,17 @@ interactions:
                   \ : null,\n    \"CleanStatus\" : \"Pending\",\n    \"DunsNumber\" : null,\n\
                   \    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" : null,\n \
                   \   \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\" : \"Account\
-                  \ 0\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n   \
-                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"ShippingCity\" : null,\n\
-                  \    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\" : null,\n\
-                  \    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n   \
-                  \ \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"ShippingStreet\"\
-                  \ : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n\
-                  \    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n    \"Type\" :\
-                  \ null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n    \"ParentId\"\
-                  \ : null\n  }, {\n    \"attributes\" : {\n      \"type\" : \"Account\",\n\
-                  \      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55hvQAB\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55hvQAB\",\n    \"AccountNumber\" : null,\n\
+                  \ 4\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n   \
+                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\" : null,\n\
+                  \    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
+                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
+                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
+                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
+                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
+                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
+                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
+                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/001Da00000xnAjmIAE\"\
+                  \n    },\n    \"Id\" : \"001Da00000xnAjmIAE\",\n    \"AccountNumber\" : null,\n\
                   \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
                   \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
                   \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
@@ -109,17 +108,17 @@ interactions:
                   \ : null,\n    \"CleanStatus\" : \"Pending\",\n    \"DunsNumber\" : null,\n\
                   \    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" : null,\n \
                   \   \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\" : \"Account\
-                  \ 1\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n   \
-                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"ShippingCity\" : null,\n\
-                  \    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\" : null,\n\
-                  \    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n   \
-                  \ \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"ShippingStreet\"\
-                  \ : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n\
-                  \    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n    \"Type\" :\
-                  \ null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n    \"ParentId\"\
-                  \ : null\n  }, {\n    \"attributes\" : {\n      \"type\" : \"Account\",\n\
-                  \      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55iFQAR\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55iFQAR\",\n    \"AccountNumber\" : null,\n\
+                  \ 0\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n   \
+                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\" : null,\n\
+                  \    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
+                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
+                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
+                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
+                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
+                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
+                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
+                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/001Da00000xnAiKIAU\"\
+                  \n    },\n    \"Id\" : \"001Da00000xnAiKIAU\",\n    \"AccountNumber\" : null,\n\
                   \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
                   \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
                   \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
@@ -127,17 +126,17 @@ interactions:
                   \ : null,\n    \"CleanStatus\" : \"Pending\",\n    \"DunsNumber\" : null,\n\
                   \    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" : null,\n \
                   \   \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\" : \"Account\
-                  \ 4\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n   \
-                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"ShippingCity\" : null,\n\
-                  \    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\" : null,\n\
-                  \    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n   \
-                  \ \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"ShippingStreet\"\
-                  \ : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n\
-                  \    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n    \"Type\" :\
-                  \ null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n    \"ParentId\"\
-                  \ : null\n  }, {\n    \"attributes\" : {\n      \"type\" : \"Account\",\n\
-                  \      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55i0QAB\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55i0QAB\",\n    \"AccountNumber\" : null,\n\
+                  \ 3\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n   \
+                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\" : null,\n\
+                  \    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
+                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
+                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
+                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
+                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
+                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
+                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
+                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/001Da00000xnAjwIAE\"\
+                  \n    },\n    \"Id\" : \"001Da00000xnAjwIAE\",\n    \"AccountNumber\" : null,\n\
                   \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
                   \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
                   \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
@@ -146,80 +145,30 @@ interactions:
                   \    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" : null,\n \
                   \   \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\" : \"Account\
                   \ 2\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" : null,\n   \
-                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"ShippingCity\" : null,\n\
-                  \    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\" : null,\n\
-                  \    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n   \
-                  \ \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"ShippingStreet\"\
-                  \ : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n\
-                  \    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n    \"Type\" :\
-                  \ null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n    \"ParentId\"\
-                  \ : null\n  } ]\n}"
-    - &id007
-      include_file: GET_sobjects_Global_describe.yaml
-    - *id004
-    - request:
-          method: GET
-          uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=SELECT+Id+FROM+Account
-          body: null
-          headers: *id001
-      response:
-          status: *id002
-          headers: *id003
-          body:
-              string: "{\n  \"totalSize\" : 6,\n  \"done\" : true,\n  \"records\" : [ {\n\
-                  \    \"attributes\" : {\n      \"type\" : \"Account\",\n      \"url\" : \"\
-                  /services/data/vxx.0/sobjects/Account/0018D00000H55hqQAB\"\n    },\n    \"\
-                  Id\" : \"0018D00000H55hqQAB\"\n  }, {\n    \"attributes\" : {\n      \"type\"\
-                  \ : \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55hvQAB\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55hvQAB\"\n  }, {\n    \"attributes\"\
-                  \ : {\n      \"type\" : \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55i0QAB\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55i0QAB\"\n  }, {\n    \"attributes\"\
-                  \ : {\n      \"type\" : \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55iAQAR\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55iAQAR\"\n  }, {\n    \"attributes\"\
-                  \ : {\n      \"type\" : \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55iFQAR\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55iFQAR\"\n  }, {\n    \"attributes\"\
-                  \ : {\n      \"type\" : \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55iKQAR\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55iKQAR\"\n  } ]\n}"
-    - &id008
-      include_file: GET_sobjects_Account_describe.yaml
-    - request:
-          method: DELETE
-          uri: https://orgname.my.salesforce.com/services/data/vxx.0/composite/sobjects?ids=0018D00000H55hqQAB,0018D00000H55hvQAB,0018D00000H55i0QAB,0018D00000H55iAQAR,0018D00000H55iFQAR,0018D00000H55iKQAR
-          body: null
-          headers: *id001
-      response:
-          status: *id002
-          headers: *id003
-          body:
-              string:
-                  "[ {\n  \"id\" : \"0018D00000H55hqQAB\",\n  \"success\" : true,\n  \"\
-                  errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55hvQAB\",\n  \"success\" :\
-                  \ true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55i0QAB\",\n  \"\
-                  success\" : true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55iAQAR\"\
-                  ,\n  \"success\" : true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55iFQAR\"\
-                  ,\n  \"success\" : true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55iKQAR\"\
-                  ,\n  \"success\" : true,\n  \"errors\" : [ ]\n} ]"
-    - request:
-          method: GET
-          uri: https://orgname.my.salesforce.com/services/data/vxx.0/limits/recordCount?sObjects=Contact
-          body: null
-          headers: *id001
-      response:
-          status: *id002
-          headers: *id003
-          body:
-              string: "{\n  \"sObjects\" : [ ]\n}"
-    - request:
+                  \ \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\" : null,\n\
+                  \    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
+                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
+                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
+                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
+                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
+                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
+                  \    \"ParentId\" : null\n  } ]\n}"
+    - &id006
+      request:
           method: GET
-          uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=SELECT+Id+FROM+Contact
+          uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=SELECT+Id%2C+DeveloperName+FROM+RecordType+WHERE+SObjectType%3D%27Account%27
           body: null
           headers: *id001
       response:
           status: *id002
           headers: *id003
           body:
-              string: "{\n  \"totalSize\" : 0,\n  \"done\" : true,\n  \"records\" : [ ]\n}"
-    - request: *id005
+              string: "{\n  \"totalSize\" : 1,\n  \"done\" : true,\n  \"records\" : [ {\n\
+                  \    \"attributes\" : {\n      \"type\" : \"RecordType\",\n      \"url\" :\
+                  \ \"/services/data/vxx.0/sobjects/RecordType/012Da000003Vv95IAC\"\n    },\n\
+                  \    \"Id\" : \"012Da000003Vv95IAC\",\n    \"DeveloperName\" : \"PytestAccountRecordType\"\
+                  \n  } ]\n}"
+    - request: *id004
       response:
           status: *id002
           headers: *id003
@@ -227,20 +176,23 @@ interactions:
               string: "{\n  \"totalSize\" : 1,\n  \"done\" : true,\n  \"records\" : [ {\n\
                   \    \"attributes\" : {\n      \"type\" : \"AggregateResult\"\n    },\n  \
                   \  \"expr0\" : 0\n  } ]\n}"
+    - *id005
+    - &id008
+      include_file: GET_sobjects_Global_describe.yaml
+    - &id007
+      include_file: GET_sobjects_Account_describe.yaml
     - *id006
     - *id007
-    - *id008
-    - *id008
     - request:
           method: POST
           uri: https://orgname.my.salesforce.com/services/data/vxx.0/composite/sobjects
           body:
               '{"allOrNone": false, "records": [{"CleanStatus": "Pending", "Name": "Account
               5", "attributes": {"type": "Account"}}, {"CleanStatus": "Pending", "Name": "Account
-              3", "attributes": {"type": "Account"}}, {"CleanStatus": "Pending", "Name": "Account
-              0", "attributes": {"type": "Account"}}, {"CleanStatus": "Pending", "Name": "Account
               1", "attributes": {"type": "Account"}}, {"CleanStatus": "Pending", "Name": "Account
               4", "attributes": {"type": "Account"}}, {"CleanStatus": "Pending", "Name": "Account
+              0", "attributes": {"type": "Account"}}, {"CleanStatus": "Pending", "Name": "Account
+              3", "attributes": {"type": "Account"}}, {"CleanStatus": "Pending", "Name": "Account
               2", "attributes": {"type": "Account"}}]}'
           headers: *id001
       response:
@@ -248,13 +200,13 @@ interactions:
           headers: *id003
           body:
               string:
-                  "[ {\n  \"id\" : \"0018D00000H55iUQAR\",\n  \"success\" : true,\n  \"\
-                  errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55iVQAR\",\n  \"success\" :\
-                  \ true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55iWQAR\",\n  \"\
-                  success\" : true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55iXQAR\"\
-                  ,\n  \"success\" : true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55iYQAR\"\
-                  ,\n  \"success\" : true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"0018D00000H55iZQAR\"\
+                  "[ {\n  \"id\" : \"001Da00000xnAkBIAU\",\n  \"success\" : true,\n  \"\
+                  errors\" : [ ]\n}, {\n  \"id\" : \"001Da00000xnAkCIAU\",\n  \"success\" :\
+                  \ true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"001Da00000xnAkDIAU\",\n  \"\
+                  success\" : true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"001Da00000xnAkEIAU\"\
+                  ,\n  \"success\" : true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"001Da00000xnAkFIAU\"\
+                  ,\n  \"success\" : true,\n  \"errors\" : [ ]\n}, {\n  \"id\" : \"001Da00000xnAkGIAU\"\
                   ,\n  \"success\" : true,\n  \"errors\" : [ ]\n} ]"
-    - *id008
     - *id007
+    - *id008
     - *id009
diff --git a/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_extract_standard_objects.yaml b/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_extract_standard_objects.yaml
index 184698e31..9f1f861b8 100644
--- a/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_extract_standard_objects.yaml
+++ b/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_extract_standard_objects.yaml
@@ -29,7 +29,7 @@ interactions:
                   \n  } ]\n}"
     - request:
           method: GET
-          uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=SELECT+Id%2C+AccountNumber%2C+AccountSource%2C+AnnualRevenue%2C+BillingCity%2C+BillingCountry%2C+BillingGeocodeAccuracy%2C+BillingLatitude%2C+BillingLongitude%2C+BillingPostalCode%2C+BillingState%2C+BillingStreet%2C+CleanStatus%2C+Description%2C+DunsNumber%2C+Fax%2C+Industry%2C+Jigsaw%2C+NaicsCode%2C+NaicsDesc%2C+Name%2C+NumberOfEmployees%2C+Ownership%2C+Phone%2C+Rating%2C+ShippingCity%2C+ShippingCountry%2C+ShippingGeocodeAccuracy%2C+ShippingLatitude%2C+ShippingLongitude%2C+ShippingPostalCode%2C+ShippingState%2C+ShippingStreet%2C+Sic%2C+SicDesc%2C+Site%2C+TickerSymbol%2C+Tradestyle%2C+Type%2C+Website%2C+YearStarted%2C+ParentId+FROM+Account+WHERE+Name+%21%3D+%27Sample+Account+for+Entitlements%27
+          uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=SELECT+Id%2C+AccountNumber%2C+AccountSource%2C+AnnualRevenue%2C+BillingCity%2C+BillingCountry%2C+BillingGeocodeAccuracy%2C+BillingLatitude%2C+BillingLongitude%2C+BillingPostalCode%2C+BillingState%2C+BillingStreet%2C+CleanStatus%2C+Description%2C+DunsNumber%2C+Fax%2C+Industry%2C+Jigsaw%2C+NaicsCode%2C+NaicsDesc%2C+Name%2C+NumberOfEmployees%2C+Ownership%2C+Phone%2C+Rating%2C+RecordTypeId%2C+ShippingCity%2C+ShippingCountry%2C+ShippingGeocodeAccuracy%2C+ShippingLatitude%2C+ShippingLongitude%2C+ShippingPostalCode%2C+ShippingState%2C+ShippingStreet%2C+Sic%2C+SicDesc%2C+Site%2C+TickerSymbol%2C+Tradestyle%2C+Type%2C+Website%2C+YearStarted%2C+ParentId+FROM+Account+WHERE+Name+%21%3D+%27Sample+Account+for+Entitlements%27
           body: null
           headers: *id002
       response:
@@ -38,8 +38,84 @@ interactions:
           body:
               string: "{\n  \"totalSize\" : 6,\n  \"done\" : true,\n  \"records\" : [ {\n\
                   \    \"attributes\" : {\n      \"type\" : \"Account\",\n      \"url\" : \"\
-                  /services/data/vxx.0/sobjects/Account/0018D00000H55ipQAB\"\n    },\n    \"\
-                  Id\" : \"0018D00000H55ipQAB\",\n    \"AccountNumber\" : null,\n    \"AccountSource\"\
+                  /services/data/vxx.0/sobjects/Account/001Da00000xnAiyIAE\"\n    },\n    \"\
+                  Id\" : \"001Da00000xnAiyIAE\",\n    \"AccountNumber\" : null,\n    \"AccountSource\"\
+                  \ : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\" : null,\n  \
+                  \  \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\" : null,\n  \
+                  \  \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n    \"BillingPostalCode\"\
+                  \ : null,\n    \"BillingState\" : null,\n    \"BillingStreet\" : null,\n \
+                  \   \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n    \"DunsNumber\"\
+                  \ : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" :\
+                  \ null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\"\
+                  \ : \"Account 4\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" :\
+                  \ null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\"\
+                  \ : null,\n    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n\
+                  \    \"ShippingGeocodeAccuracy\" : null,\n    \"ShippingLatitude\" : null,\n\
+                  \    \"ShippingLongitude\" : null,\n    \"ShippingPostalCode\" : null,\n \
+                  \   \"ShippingState\" : null,\n    \"ShippingStreet\" : null,\n    \"Sic\"\
+                  \ : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n    \"TickerSymbol\"\
+                  \ : null,\n    \"Tradestyle\" : null,\n    \"Type\" : null,\n    \"Website\"\
+                  \ : null,\n    \"YearStarted\" : null,\n    \"ParentId\" : null\n  }, {\n\
+                  \    \"attributes\" : {\n      \"type\" : \"Account\",\n      \"url\" : \"\
+                  /services/data/vxx.0/sobjects/Account/001Da00000xnAijIAE\"\n    },\n    \"\
+                  Id\" : \"001Da00000xnAijIAE\",\n    \"AccountNumber\" : null,\n    \"AccountSource\"\
+                  \ : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\" : null,\n  \
+                  \  \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\" : null,\n  \
+                  \  \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n    \"BillingPostalCode\"\
+                  \ : null,\n    \"BillingState\" : null,\n    \"BillingStreet\" : null,\n \
+                  \   \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n    \"DunsNumber\"\
+                  \ : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" :\
+                  \ null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\"\
+                  \ : \"Account 0\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" :\
+                  \ null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\"\
+                  \ : null,\n    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n\
+                  \    \"ShippingGeocodeAccuracy\" : null,\n    \"ShippingLatitude\" : null,\n\
+                  \    \"ShippingLongitude\" : null,\n    \"ShippingPostalCode\" : null,\n \
+                  \   \"ShippingState\" : null,\n    \"ShippingStreet\" : null,\n    \"Sic\"\
+                  \ : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n    \"TickerSymbol\"\
+                  \ : null,\n    \"Tradestyle\" : null,\n    \"Type\" : null,\n    \"Website\"\
+                  \ : null,\n    \"YearStarted\" : null,\n    \"ParentId\" : null\n  }, {\n\
+                  \    \"attributes\" : {\n      \"type\" : \"Account\",\n      \"url\" : \"\
+                  /services/data/vxx.0/sobjects/Account/001Da00000xnAhlIAE\"\n    },\n    \"\
+                  Id\" : \"001Da00000xnAhlIAE\",\n    \"AccountNumber\" : null,\n    \"AccountSource\"\
+                  \ : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\" : null,\n  \
+                  \  \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\" : null,\n  \
+                  \  \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n    \"BillingPostalCode\"\
+                  \ : null,\n    \"BillingState\" : null,\n    \"BillingStreet\" : null,\n \
+                  \   \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n    \"DunsNumber\"\
+                  \ : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" :\
+                  \ null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\"\
+                  \ : \"Account 2\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" :\
+                  \ null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\"\
+                  \ : null,\n    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n\
+                  \    \"ShippingGeocodeAccuracy\" : null,\n    \"ShippingLatitude\" : null,\n\
+                  \    \"ShippingLongitude\" : null,\n    \"ShippingPostalCode\" : null,\n \
+                  \   \"ShippingState\" : null,\n    \"ShippingStreet\" : null,\n    \"Sic\"\
+                  \ : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n    \"TickerSymbol\"\
+                  \ : null,\n    \"Tradestyle\" : null,\n    \"Type\" : null,\n    \"Website\"\
+                  \ : null,\n    \"YearStarted\" : null,\n    \"ParentId\" : null\n  }, {\n\
+                  \    \"attributes\" : {\n      \"type\" : \"Account\",\n      \"url\" : \"\
+                  /services/data/vxx.0/sobjects/Account/001Da00000xnAioIAE\"\n    },\n    \"\
+                  Id\" : \"001Da00000xnAioIAE\",\n    \"AccountNumber\" : null,\n    \"AccountSource\"\
+                  \ : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\" : null,\n  \
+                  \  \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\" : null,\n  \
+                  \  \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n    \"BillingPostalCode\"\
+                  \ : null,\n    \"BillingState\" : null,\n    \"BillingStreet\" : null,\n \
+                  \   \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n    \"DunsNumber\"\
+                  \ : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" :\
+                  \ null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\"\
+                  \ : \"Account 1\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" :\
+                  \ null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\"\
+                  \ : null,\n    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n\
+                  \    \"ShippingGeocodeAccuracy\" : null,\n    \"ShippingLatitude\" : null,\n\
+                  \    \"ShippingLongitude\" : null,\n    \"ShippingPostalCode\" : null,\n \
+                  \   \"ShippingState\" : null,\n    \"ShippingStreet\" : null,\n    \"Sic\"\
+                  \ : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n    \"TickerSymbol\"\
+                  \ : null,\n    \"Tradestyle\" : null,\n    \"Type\" : null,\n    \"Website\"\
+                  \ : null,\n    \"YearStarted\" : null,\n    \"ParentId\" : null\n  }, {\n\
+                  \    \"attributes\" : {\n      \"type\" : \"Account\",\n      \"url\" : \"\
+                  /services/data/vxx.0/sobjects/Account/001Da00000xnAitIAE\"\n    },\n    \"\
+                  Id\" : \"001Da00000xnAitIAE\",\n    \"AccountNumber\" : null,\n    \"AccountSource\"\
                   \ : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\" : null,\n  \
                   \  \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\" : null,\n  \
                   \  \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n    \"BillingPostalCode\"\
@@ -48,104 +124,47 @@ interactions:
                   \ : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" :\
                   \ null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\"\
                   \ : \"Account 3\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" :\
-                  \ null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"ShippingCity\"\
-                  \ : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
-                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
-                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
-                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
-                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
-                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
-                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
-                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55hYQAR\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55hYQAR\",\n    \"AccountNumber\" : null,\n\
-                  \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
-                  \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
-                  \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
-                  \    \"BillingPostalCode\" : null,\n    \"BillingState\" : null,\n    \"BillingStreet\"\
-                  \ : null,\n    \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n\
-                  \    \"DunsNumber\" : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n\
-                  \    \"Jigsaw\" : null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n\
-                  \    \"Name\" : \"Account 0\",\n    \"NumberOfEmployees\" : null,\n    \"\
-                  Ownership\" : null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"\
-                  ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
-                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
-                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
-                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
-                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
-                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
-                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
-                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55ifQAB\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55ifQAB\",\n    \"AccountNumber\" : null,\n\
-                  \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
-                  \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
-                  \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
-                  \    \"BillingPostalCode\" : null,\n    \"BillingState\" : null,\n    \"BillingStreet\"\
-                  \ : null,\n    \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n\
-                  \    \"DunsNumber\" : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n\
-                  \    \"Jigsaw\" : null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n\
-                  \    \"Name\" : \"Account 1\",\n    \"NumberOfEmployees\" : null,\n    \"\
-                  Ownership\" : null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"\
-                  ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
-                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
-                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
-                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
-                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
-                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
-                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
-                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55izQAB\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55izQAB\",\n    \"AccountNumber\" : null,\n\
-                  \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
-                  \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
-                  \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
-                  \    \"BillingPostalCode\" : null,\n    \"BillingState\" : null,\n    \"BillingStreet\"\
-                  \ : null,\n    \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n\
-                  \    \"DunsNumber\" : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n\
-                  \    \"Jigsaw\" : null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n\
-                  \    \"Name\" : \"Account 5\",\n    \"NumberOfEmployees\" : null,\n    \"\
-                  Ownership\" : null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"\
-                  ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
-                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
-                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
-                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
-                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
-                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
-                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
-                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55ikQAB\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55ikQAB\",\n    \"AccountNumber\" : null,\n\
-                  \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
-                  \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
-                  \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
-                  \    \"BillingPostalCode\" : null,\n    \"BillingState\" : null,\n    \"BillingStreet\"\
-                  \ : null,\n    \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n\
-                  \    \"DunsNumber\" : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n\
-                  \    \"Jigsaw\" : null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n\
-                  \    \"Name\" : \"Account 2\",\n    \"NumberOfEmployees\" : null,\n    \"\
-                  Ownership\" : null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"\
-                  ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
-                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
-                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
-                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
-                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
-                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
-                  \    \"ParentId\" : null\n  }, {\n    \"attributes\" : {\n      \"type\" :\
-                  \ \"Account\",\n      \"url\" : \"/services/data/vxx.0/sobjects/Account/0018D00000H55iuQAB\"\
-                  \n    },\n    \"Id\" : \"0018D00000H55iuQAB\",\n    \"AccountNumber\" : null,\n\
-                  \    \"AccountSource\" : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\"\
-                  \ : null,\n    \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\"\
-                  \ : null,\n    \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n\
-                  \    \"BillingPostalCode\" : null,\n    \"BillingState\" : null,\n    \"BillingStreet\"\
-                  \ : null,\n    \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n\
-                  \    \"DunsNumber\" : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n\
-                  \    \"Jigsaw\" : null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n\
-                  \    \"Name\" : \"Account 4\",\n    \"NumberOfEmployees\" : null,\n    \"\
-                  Ownership\" : null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"\
-                  ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n    \"ShippingGeocodeAccuracy\"\
-                  \ : null,\n    \"ShippingLatitude\" : null,\n    \"ShippingLongitude\" : null,\n\
-                  \    \"ShippingPostalCode\" : null,\n    \"ShippingState\" : null,\n    \"\
-                  ShippingStreet\" : null,\n    \"Sic\" : null,\n    \"SicDesc\" : null,\n \
-                  \   \"Site\" : null,\n    \"TickerSymbol\" : null,\n    \"Tradestyle\" : null,\n\
-                  \    \"Type\" : null,\n    \"Website\" : null,\n    \"YearStarted\" : null,\n\
-                  \    \"ParentId\" : null\n  } ]\n}"
+                  \ null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\"\
+                  \ : null,\n    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n\
+                  \    \"ShippingGeocodeAccuracy\" : null,\n    \"ShippingLatitude\" : null,\n\
+                  \    \"ShippingLongitude\" : null,\n    \"ShippingPostalCode\" : null,\n \
+                  \   \"ShippingState\" : null,\n    \"ShippingStreet\" : null,\n    \"Sic\"\
+                  \ : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n    \"TickerSymbol\"\
+                  \ : null,\n    \"Tradestyle\" : null,\n    \"Type\" : null,\n    \"Website\"\
+                  \ : null,\n    \"YearStarted\" : null,\n    \"ParentId\" : null\n  }, {\n\
+                  \    \"attributes\" : {\n      \"type\" : \"Account\",\n      \"url\" : \"\
+                  /services/data/vxx.0/sobjects/Account/001Da00000xnAj3IAE\"\n    },\n    \"\
+                  Id\" : \"001Da00000xnAj3IAE\",\n    \"AccountNumber\" : null,\n    \"AccountSource\"\
+                  \ : null,\n    \"AnnualRevenue\" : null,\n    \"BillingCity\" : null,\n  \
+                  \  \"BillingCountry\" : null,\n    \"BillingGeocodeAccuracy\" : null,\n  \
+                  \  \"BillingLatitude\" : null,\n    \"BillingLongitude\" : null,\n    \"BillingPostalCode\"\
+                  \ : null,\n    \"BillingState\" : null,\n    \"BillingStreet\" : null,\n \
+                  \   \"CleanStatus\" : \"Pending\",\n    \"Description\" : null,\n    \"DunsNumber\"\
+                  \ : null,\n    \"Fax\" : null,\n    \"Industry\" : null,\n    \"Jigsaw\" :\
+                  \ null,\n    \"NaicsCode\" : null,\n    \"NaicsDesc\" : null,\n    \"Name\"\
+                  \ : \"Account 5\",\n    \"NumberOfEmployees\" : null,\n    \"Ownership\" :\
+                  \ null,\n    \"Phone\" : null,\n    \"Rating\" : null,\n    \"RecordTypeId\"\
+                  \ : null,\n    \"ShippingCity\" : null,\n    \"ShippingCountry\" : null,\n\
+                  \    \"ShippingGeocodeAccuracy\" : null,\n    \"ShippingLatitude\" : null,\n\
+                  \    \"ShippingLongitude\" : null,\n    \"ShippingPostalCode\" : null,\n \
+                  \   \"ShippingState\" : null,\n    \"ShippingStreet\" : null,\n    \"Sic\"\
+                  \ : null,\n    \"SicDesc\" : null,\n    \"Site\" : null,\n    \"TickerSymbol\"\
+                  \ : null,\n    \"Tradestyle\" : null,\n    \"Type\" : null,\n    \"Website\"\
+                  \ : null,\n    \"YearStarted\" : null,\n    \"ParentId\" : null\n  } ]\n}"
+    - request:
+          method: GET
+          uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=SELECT+Id%2C+DeveloperName+FROM+RecordType+WHERE+SObjectType%3D%27Account%27
+          body: null
+          headers: *id002
+      response:
+          status: *id003
+          headers: *id004
+          body:
+              string: "{\n  \"totalSize\" : 1,\n  \"done\" : true,\n  \"records\" : [ {\n\
+                  \    \"attributes\" : {\n      \"type\" : \"RecordType\",\n      \"url\" :\
+                  \ \"/services/data/vxx.0/sobjects/RecordType/012Da000003Vv95IAC\"\n    },\n\
+                  \    \"Id\" : \"012Da000003Vv95IAC\",\n    \"DeveloperName\" : \"PytestAccountRecordType\"\
+                  \n  } ]\n}"
     - request:
           method: GET
           uri: https://orgname.my.salesforce.com/services/data/vxx.0/limits/recordCount?sObjects=Contact
diff --git a/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_read_explicit_extract_declaration.yaml b/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_read_explicit_extract_declaration.yaml
new file mode 100644
index 000000000..86d77843f
--- /dev/null
+++ b/cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_read_explicit_extract_declaration.yaml
@@ -0,0 +1,3 @@
+version: 1
+interactions:
+    - include_file: GET_sobjects_Organization.yaml
diff --git a/cumulusci/core/tests/test_datasets_e2e.py b/cumulusci/core/tests/test_datasets_e2e.py
index 9695b78f2..3033e5c06 100644
--- a/cumulusci/core/tests/test_datasets_e2e.py
+++ b/cumulusci/core/tests/test_datasets_e2e.py
@@ -103,6 +103,9 @@ class TestDatasetsE2E:
     def demo_dataset(
         self, dataset, timer, sf, delete_data_from_org, run_code_without_recording
     ):
+        # Need record types for the RecordTypeId field to be in the org
+        create_record_type_for_account(sf, run_code_without_recording)
+
         def count(sobject):
             return sf.query(f"select count(Id) from {sobject}")["records"][0]["expr0"]
 
@@ -155,7 +158,13 @@ class TestDatasetsE2E:
         timer.checkpoint("Verified")
 
     def test_datasets_extract_standard_objects(
-        self, sf, project_config, org_config, delete_data_from_org, ensure_accounts
+        self,
+        sf,
+        project_config,
+        org_config,
+        delete_data_from_org,
+        ensure_accounts,
+        run_code_without_recording,
     ):
         timer = Timer()
         timer.checkpoint("Started")
@@ -165,6 +174,9 @@ class TestDatasetsE2E:
             describe_for("Contact"),
             describe_for("Opportunity"),
         )
+        # Need record types for the RecordTypeId field to be in the org
+        create_record_type_for_account(sf, run_code_without_recording)
+
         with patch.object(type(org_config), "is_person_accounts_enabled", False), patch(
             "cumulusci.core.datasets.get_org_schema",
             lambda _sf, org_config, **kwargs: _fake_get_org_schema(
@@ -282,3 +294,21 @@ class TestLoadDatasets:
             "fxoyoxz", project_config, sf, org_config, schema=None
         ) as dataset, pytest.raises(BulkDataException, match="fxoyoxz"):
             dataset.load()
+
+
+# Need record types for the RecordTypeId field to be in the org
+def create_record_type_for_account(sf, run_code_without_recording):
+    def create_record_type_for_account_real():
+        account_record_types = sf.query(
+            "select Count(Id) from RecordType where SObjectType='Account'"
+        )
+        if account_record_types["records"][0]["expr0"] == 0:
+            sf.RecordType.create(
+                {
+                    "DeveloperName": "PytestAccountRecordType",
+                    "Name": "PytestAccountRecordType",
+                    "SObjectType": "Account",
+                }
+            )
+
+    run_code_without_recording(create_record_type_for_account_real)