code: def get_count(dataset, query=None):
      
      # https://gis.stackexchange.com/questions/45101/only-return-the-numberoffeatures-in-a-wfs-query
      table = validate_name(dataset)
      payload = {
          "service": "WFS",
          "version": "2.0.0",
          "request": "GetFeature",
          "typeName": table,
          "resultType": "hits",
          "outputFormat": "json",
      }
      if query:
          payload["CQL_FILTER"] = query
      r = requests.get(bcdata.WFS_URL, params=payload)
      return int(ET.fromstring(r.text).attrib["numberMatched"])
docs: Ask DataBC WFS how many features there are in a table/query