While querying Feature Layer getting Exception as "TypeError: '>=' not supported between instances of 'int' and 'NoneType' "
But the same outStatistics value and where clause is working fine in the REST end point in the browser, and giving the expected result.
// Below code is giving Exception
feats = fl.query(where=where, out_fields=outFields, gdb_version=self._versionName if not IgnoreVersion else None, return_all_records=returnAll,
result_record_count=resultRecordCount, return_geometry = hasGeometry, result_offset=resultOffset, historic_moment=historicMoment,
out_statistics=outStatistics, group_by_fields_for_statistics=groupByFieldsForStatistics )
""" Below are the Parameter's variable values for your reference.
where = "assetgroup IN (20)"
outFields = '*'
IgnoreVersion = False
returnAll = True
resultRecordCount = None
hasGeometry = False
resultOffset = None
historicMoment = None
outStatistics = [{'statisticType': 'sum', 'onStatisticField': 'customercount', 'outStatisticFieldName': 'TotalCustomerCount'}]
groupByFieldsForStatistics = None
"""
Other way I tried was this, but in this code also getting same error:
// Below code is also giving Exception
feats = fl.query(where=where, gdb_version=self._versionName if not IgnoreVersion else None,
return_geometry = hasGeometry, result_offset = 0,
result_record_count = 1000,
out_statistics = outStatistics)
However, the normal query without statistics is working fine.
// Below code is Working perfect
feats = fl.query(where=where, out_fields=outFields, gdb_version=self._versionName if not IgnoreVersion else None, return_all_records=returnAll,
result_record_count=resultRecordCount, return_geometry = hasGeometry, result_offset=resultOffset, historic_moment=historicMoment )