Skip to content
This repository has been archived by the owner. It is now read-only.

Fix edges queries for cluster cassandra #99

Merged
merged 6 commits into from Aug 16, 2017

Conversation

Projects
None yet
3 participants
@c-w
Copy link
Member

commented Aug 15, 2017

Depends on this schema change: CatalystCode/project-fortis-pipeline#110

@c-w c-w requested a review from erikschlegel Aug 15, 2017

@c-w c-w added the in progress label Aug 15, 2017

@c-w c-w force-pushed the fix-edges-queries branch from b07e815 to 778db4a Aug 16, 2017


const query = `
SELECT placename, placeid, mentioncount
SELECT placeid, mentioncount, centroidlat, centroidlon

This comment has been minimized.

Copy link
@erikschlegel

erikschlegel Aug 16, 2017

Collaborator

This query should factor in the bbox coordinates.

This comment has been minimized.

Copy link
@c-w

c-w Aug 16, 2017

Author Member

Added new feature in 4db00c6. Will also require client-side change since bbox was not considered in Fortis-v1.

@Smarker
Copy link
Contributor

left a comment

LGTM - with comments

function formatIdsUri(ids) {
return `${apiUrlBase}/features/id/${ids.map(encodeURIComponent).join(',')}?include=bbox`;
function formatIdsUri(ids, include) {
let uri = `${apiUrlBase}/features/id/${ids.map(encodeURIComponent).join(',')}`;

This comment has been minimized.

Copy link
@Smarker

Smarker Aug 16, 2017

Contributor

What about using const for uri? (there's a couple of other instances where there's let uri)

This comment has been minimized.

Copy link
@c-w

c-w Aug 16, 2017

Author Member

The uri is being mutated just below so it can't be const :)

return `${apiUrlBase}/features/id/${ids.map(encodeURIComponent).join(',')}?include=bbox`;
function formatIdsUri(ids, include) {
let uri = `${apiUrlBase}/features/id/${ids.map(encodeURIComponent).join(',')}`;
if (include) uri += `?include=${include}`;

This comment has been minimized.

Copy link
@Smarker

Smarker Aug 16, 2017

Contributor

Not really sure what include is from the name.

This comment has been minimized.

Copy link
@c-w

c-w Aug 16, 2017

Author Member

Renamed in 436c114.

@@ -6,20 +6,28 @@ const trackDependency = require('../appinsights/AppInsightsClient').trackDepende

const apiUrlBase = process.env.FORTIS_FEATURE_SERVICE_HOST;

function formatIdsUri(ids) {
return `${apiUrlBase}/features/id/${ids.map(encodeURIComponent).join(',')}?include=bbox`;
function formatIdsUri(ids, include) {

This comment has been minimized.

Copy link
@Smarker

Smarker Aug 16, 2017

Contributor

Does include have to be a parameter passed in to all of these methods? Could it be a member of the FeatureServiceClient?

This comment has been minimized.

Copy link
@c-w

c-w Aug 16, 2017

Author Member

FeatureServiceClient is not an object, these are all just functions. What we want to include depends on the context of the request (e.g. some callers need the bbox, others don't), so this really should be configurable on a per-call level.

@c-w c-w merged commit 0b6c61d into master Aug 16, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@c-w c-w deleted the fix-edges-queries branch Aug 16, 2017

@c-w c-w removed the in progress label Aug 16, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.