[bug fix] Added fit=true
parameter when setting a dataframe
#1318
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to: https://sagebionetworks.jira.com/browse/FDS-919
Context:
We ran into a problem when generating a manifest for HTAN. See the parameters used for manifest generation below:
schema_url: https://raw.githubusercontent.com/ncihtan/data-models/main/HTAN.model.jsonld
data_type: ImagingLevel1
dataset_id: syn27782965
output_format: google_sheet
The error:
Why this error occurred?
In schematic, we are essentially copying and pasting the dataframe that we generated into google sheet as a final step. The library that we use is called pygsheet, and the function is: set_dataframe (You could read more about this function here). This error happened because the google sheet that we initially generated only has 1000 rows (see documentation here), but since the data frame that we pasted is much bigger, the error occurred.(Refer to the comment here).
Solution
Luckily the fix is simple. We could resize the google sheet that we initially generated to fit the bigger dataframe by using the
fit
parameter described here in the documentation: https://pygsheets.readthedocs.io/en/stable/worksheet.html?highlight=set_dataframe#pygsheets.Worksheet.set_dataframeTo test this PR
Use the parameter described above to generate a google sheet manifest for HTAN
Cell limit
To understand the cell limit, please consider using the script in the comment