Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate crop columns. #26

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/scripts/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,9 @@
}
} else if (typeof short_desc === "object" && cropUnits) {
const attr = short_desc[cropUnits as keyof ICropDataItem][0];
allAttrs.push({"name": attrToCODAPColumnName[attr].attributeNameInCodapTable});
const codapColumnName = attrToCODAPColumnName[attr].attributeNameInCodapTable;
const codapColumnUnit = attrToCODAPColumnName[attr].unitInCodapTable;
allAttrs.push({"name": codapColumnName, "unit": codapColumnUnit});
allAttrs.push({"name": codapColumnName, "unit": codapColumnUnit});
}
}
}
Expand Down Expand Up @@ -209,6 +208,7 @@
return "success";
} else {
const attrDefinitions = allAttrs.map((attr) => makeCODAPAttributeDef(attr, geographicLevel));
console.log("attrDefinitions", attrDefinitions);

Check warning on line 211 in src/scripts/api.ts

View workflow job for this annotation

GitHub Actions / Build and Run Jest Tests

Unexpected console statement

Check warning on line 211 in src/scripts/api.ts

View workflow job for this annotation

GitHub Actions / S3 Deploy

Unexpected console statement
await createParentCollection(dataSetName, "Data", attrDefinitions);
await createItems(dataSetName, items);
await createTable(dataSetName, dataSetName);
Expand Down Expand Up @@ -365,7 +365,7 @@
if (res2017 && resOtherYears) {
return [...res2017.data, ...resOtherYears.data];
} else {
console.log(`Error: did not receive resposnse for this request:`, req);

Check warning on line 368 in src/scripts/api.ts

View workflow job for this annotation

GitHub Actions / Build and Run Jest Tests

Unexpected console statement

Check warning on line 368 in src/scripts/api.ts

View workflow job for this annotation

GitHub Actions / S3 Deploy

Unexpected console statement
}
} else {
const res = await fetchDataWithRetry(req, setReqCount);
Expand Down
Loading