<commit_before>const axios = require('axios');

let xyCache = null;
let cacheDate = null;

function prepareProjects(rows) {
  if (rows.length === 0) return [];
  return rows.map(itm => {
    let latitude = [];
    let longitude = [];
    if (xyCache.hasOwnProperty(itm.project)) {
      latitude = xyCache[itm.project].latitude;
      longitude = xyCache[itm.project].longitude;
    }
    return {
      gis_id: itm.gis_id,
      munis_project_number: itm.munis_project_number,
      project: itm.project,
      display_name: itm.display_name,
      location_details: itm.location_details,
      zip_code: itm.zip_code,
      type: itm.type,
      category: itm.category,
      category_number: itm.display_order,
      coa_contact: itm.coa_contact,
      phone_number: itm.phone_number,
      email_address: itm.email_address,
      owner_department: itm.owner_department,
      administering_department: itm.administering_department,
      project_description: itm.project_description,
      status: itm.status,
      total_project_funding_budget_document: itm.total_project_funding_budget_d,
      total_spent: itm.ltd_actuals ? itm.ltd_actuals : 0,
      encumbered: itm.encumbrances ? itm.encumbrances : 0,
      target_construction_start: itm.target_construction_start,
      target_construction_end: itm.target_construction_end,
      actual_construction_end: itm.actual_construction_end,
      amount_behind_schedule: itm.amount_behind_schedule,
      estimated_construction_duration: itm.estimated_construction_duration,
      project_folder: itm.project_folder,
      project_webpage_more_information: itm.project_webpage__more_information_,
      communication_plan: itm.communication_plan,
      photo_url: itm.photo_url,
      project_updates: itm.project_updates,
      latitude,
      longitude,
    };
  });
}

const resolvers = {
  Query: {
    cip_project_categories(obj, args, context) {
      const pool = context.pool;
      const query = 'select C.category_name, C.display_order, '
      + 'COUNT(M.objectid) AS total_count, '
      + "SUM(CASE WHEN M.type = 'Bond' THEN 1 ELSE 0 END) AS bond_count "<commit_msg>Fixed a bug in column name for CIP project webpage link<commit_after>const axios = require('axios');

let xyCache = null;
let cacheDate = null;

function prepareProjects(rows) {
  if (rows.length === 0) return [];
  return rows.map(itm => {
    let latitude = [];
    let longitude = [];
    if (xyCache.hasOwnProperty(itm.project)) {
      latitude = xyCache[itm.project].latitude;
      longitude = xyCache[itm.project].longitude;
    }
    console.log(itm);
    return {
      gis_id: itm.gis_id,
      munis_project_number: itm.munis_project_number,
      project: itm.project,
      display_name: itm.display_name,
      location_details: itm.location_details,
      zip_code: itm.zip_code,
      type: itm.type,
      category: itm.category,
      category_number: itm.display_order,
      coa_contact: itm.coa_contact,
      phone_number: itm.phone_number,
      email_address: itm.email_address,
      owner_department: itm.owner_department,
      administering_department: itm.administering_department,
      project_description: itm.project_description,
      status: itm.status,
      total_project_funding_budget_document: itm.total_project_funding_budget_d,
      total_spent: itm.ltd_actuals ? itm.ltd_actuals : 0,
      encumbered: itm.encumbrances ? itm.encumbrances : 0,
      target_construction_start: itm.target_construction_start,
      target_construction_end: itm.target_construction_end,
      actual_construction_end: itm.actual_construction_end,
      amount_behind_schedule: itm.amount_behind_schedule,
      estimated_construction_duration: itm.estimated_construction_duration,
      project_folder: itm.project_folder,
      project_webpage_more_information: itm.project_webpage_more_informati,
      communication_plan: itm.communication_plan,
      photo_url: itm.photo_url,
      project_updates: itm.project_updates,
      latitude,
      longitude,
    };
  });
}

const resolvers = {
  Query: {
    cip_project_categories(obj, args, context) {
      const pool = context.pool;
      const query = 'select C.category_name, C.display_order, '
      + 'COUNT(M.objectid) AS total_count, '
      + "SUM(CASE WHEN M.type = 'Bond' THEN 1 ELSE 0 END) AS bond_count "
{'fraction_non_alphanumeric': 0.09103512014787431, 'fraction_numerical': 0.0023105360443622922, 'mean_word_length': 3.6200640341515475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2608955', 'n_tokens_mistral': 1475, 'n_tokens_neox': 1435, 'n_words': 251}