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
Merged

Fix edges queries for cluster cassandra #99

merged 6 commits into from Aug 16, 2017

Conversation

@c-w
Copy link
Contributor

@c-w c-w 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 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
Copy link
Collaborator

@erikschlegel erikschlegel Aug 16, 2017

This query should factor in the bbox coordinates.

Copy link
Contributor Author

@c-w c-w Aug 16, 2017

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

Copy link
Contributor

@Smarker Smarker 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(',')}`;
Copy link
Contributor

@Smarker Smarker Aug 16, 2017

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

Copy link
Contributor Author

@c-w c-w Aug 16, 2017

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}`;
Copy link
Contributor

@Smarker Smarker Aug 16, 2017

Not really sure what include is from the name.

Copy link
Contributor Author

@c-w c-w Aug 16, 2017

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) {
Copy link
Contributor

@Smarker Smarker Aug 16, 2017

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

Copy link
Contributor Author

@c-w c-w Aug 16, 2017

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
@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.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants