Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Commit

Permalink
Merge pull request #110 from CatalystCode/fix-sentiment
Browse files Browse the repository at this point in the history
Fix sentiment dereference for latest model changes
  • Loading branch information
c-w committed Aug 17, 2017
2 parents 6127170 + 62c0ee2 commit 376c80d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/resolvers-cassandra/Tiles/queries.js
Expand Up @@ -9,12 +9,12 @@ const { trackEvent } = require('../../clients/appinsights/AppInsightsClient');
const { makeSet } = require('../../utils/collections');

/**
* @param {{tilex: number, tiley: number, tilez: number, avgsentiment: number, mentioncount: number}} rows
* @param {{tilex: number, tiley: number, tilez: number, avgsentimentnumerator: number, mentioncount: number}} rows
*/
function computedtileToTile(row) {
const coordinates = [geotile.longitudeFromColumn(row.tiley, row.tilez), geotile.latitudeFromRow(row.tilex, row.tilez)];
const mentionCount = row.mentioncount;
const neg_sentiment = row.avgsentiment;
const neg_sentiment = row.mentioncount > 0 ? row.avgsentimentnumerator / row.mentioncount : null;
const tileId = geotile.tileIdFromRowColumn(row.tilex, row.tiley, row.tilez);

return {
Expand All @@ -32,7 +32,7 @@ function queryComputedTiles(tiles, args) {
const tiley = makeSet(tiles, tile => tile.column);

const query = `
SELECT tilex, tiley, tilez, avgsentiment, mentioncount
SELECT tilex, tiley, tilez, avgsentimentnumerator, mentioncount
FROM fortis.computedtiles
WHERE periodtype = ?
AND conjunctiontopic1 = ?
Expand Down

0 comments on commit 376c80d

Please sign in to comment.