The Get Count (Data Management) geoprocessing tool does not return the correct number of rows for a feature class registered as branch versioned after an append or delete features operation when run via a Python script tool; an incorrect number of features is exported when the Export Features (Conversion) tool is used within the same Python script tool after an append or delete operation.
The issue is non-reproducible in ArcGIS Pro 3.3.
The modified script used:
import arcpy
import os
source=path_to_fgdb_fc
lyr=path_to_branch_vc
workspace = os.path.dirname(lyr)
with arcpy.da.Editor(workspace):
arcpy.AddMessage(f"Before:{arcpy.management.GetCount(lyr)}")
##append features to branch-versioned fc
arcpy.management.Append(inputs=source,target=lyr,schema_type="TEST",field_mapping=None,subtype="",expression="",match_fields=None,update_geometry="NOT_UPDATE_GEOMETRY")
##Delete features to branch-versioned fc
##arcpy.management.DeleteFeatures(in_features="DATAOWNER.test_branch_fc")
arcpy.AddMessage(f"After:{arcpy.management.GetCount(lyr)}")