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

Asana & GoogleSheets improvements #495

Merged
merged 15 commits into from
Apr 3, 2024
Merged

Asana & GoogleSheets improvements #495

merged 15 commits into from
Apr 3, 2024

Conversation

mtuchi
Copy link
Collaborator

@mtuchi mtuchi commented Mar 26, 2024

Summary

Improvements for Asana and GoogleSheet adaptor driven from OpenFn/ConSoSci#204 and OpenFn/ConSoSci#206

Details

Asana

  • add createTaskStory() func
  • use new http from common/util

GoogleSheets

  • add getValues() function
  • add batchUpdateValues() function
  • use expandReference() from common/util
  • improve the code to use a google client before the begin of operations
  • add logError function for in-depth error logs

Issues

Closes #497, #301

Review Checklist

  • Does the PR do what it claims to do?
  • Are there any unit tests? Should there be?
  • Is there a changeset associated with this PR? Should there be? Note that
    dev only changes don't need a changeset.

@mtuchi mtuchi changed the title Improvements for WCS project Asana & GoogleSheets improvements Apr 3, 2024
@mtuchi mtuchi requested a review from josephjclark April 3, 2024 11:18
@mtuchi mtuchi marked this pull request as ready for review April 3, 2024 11:18
Copy link
Collaborator

@josephjclark josephjclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of suggestions!

packages/asana/src/Adaptor.js Outdated Show resolved Hide resolved
packages/asana/src/Utils.js Outdated Show resolved Hide resolved
packages/asana/src/Adaptor.js Outdated Show resolved Hide resolved
packages/asana/src/Adaptor.js Show resolved Hide resolved
packages/asana/src/Adaptor.js Outdated Show resolved Hide resolved
packages/asana/src/Adaptor.js Outdated Show resolved Hide resolved
packages/googlesheets/src/Adaptor.js Outdated Show resolved Hide resolved
const numRows = response?.data?.values.length ?? 0;
console.log(`${numRows} rows retrieved.`);

const nextState = { ...composeNextState(state, response.data), response };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wonder if large data arrays are double-buffered here in state.data and state.response.

This might be a difficult situation I've stumbled into 😬

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean duplicates ? or what do you mean by double-buffered ? @josephjclark

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I mean duplicates!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am worried I'm creating more problems than I'm fixing here. Let's leave this as it is for now!

@mtuchi mtuchi requested a review from josephjclark April 3, 2024 14:45
@mtuchi mtuchi merged commit b7cdec6 into main Apr 3, 2024
1 check passed
@mtuchi mtuchi deleted the wcs-requests branch April 3, 2024 17:16
This was referenced Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

googlesheets: add getValues()
2 participants