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

Return data instead of void for export node #11666

Merged
merged 2 commits into from
May 7, 2021

Conversation

QilongTang
Copy link
Contributor

@QilongTang QilongTang commented May 5, 2021

Please Note:

  1. Before submitting the PR, please review How to Contribute to Dynamo
  2. Dynamo Team will meet 1x a month to review PRs found on Github (Issues will be handled separately)
  3. PRs will be reviewed from oldest to newest
  4. If a reviewed PR requires changes by the owner, the owner of the PR has 30 days to respond. If the PR has seen no activity by the next session, it will be either closed by the team or depending on its utility will be taken over by someone on the team
  5. PRs should use either Dynamo's default PR template or one of these other template options in order to be considered for review.
  6. PRs that do not have one of the Dynamo PR templates completely filled out with all declarations satisfied will not be reviewed by the Dynamo team.
  7. PRs made to the DynamoRevit repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after a LGTM label is added to the PR.

Purpose

Return bool instead of void for node OpenXMLExportExcel to indicate of the node has successfully written data into spreadsheet

image

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Reviewers

@mmisol

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

Copy link
Collaborator

@mmisol mmisol left a comment

Choose a reason for hiding this comment

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

Hi @QilongTang . I'm afraid this approach is not compatible with what the Data.ExportToExcel node does. That was my reason for returning void in the first place. Allow me to illustrate with an example.

Starting with this spreadsheet:
Excel_Sheet

And using this graph to only write the "C3" cell:
Graph

You can see in the watch node that the Data.ExportToExcel node returns all of the spreadsheet data. However, if I tried this with the Data.OpenXmlExportExcel node I would only get the passed in data, that is 20.

Given the differences in the implementations of the nodes, I don't think there is an easy way to do this, other than doing what the Data.OpenXmlImportExcel node does, but that might be overkill considering the spreadsheet data might no be needed after written and also users can always use the Data.OpenXmlImportExcel node itself if they do need it.

@mjkkirschner
Copy link
Member

mjkkirschner commented May 5, 2021 via email

@QilongTang
Copy link
Contributor Author

@mmisol @mjkkirschner I can change the implementation so that we always follow up the write request with a read function call so that this node could return all the data. This may not be 100% ideal performance wise but will be purely done for consistency, what do you think?

@mjkkirschner
Copy link
Member

@QilongTang can we characterize what the performance cost is?

@mmisol
Copy link
Collaborator

mmisol commented May 5, 2021

@mjkkirschner That would depend on the size of the sheet. If we are dealing with one that is very large, it could take a few extra seconds, plus a chunk of memory. I think returning something like a bool should work too, so if it's more idiomatic for Dynamo I'm fine with that.

Copy link
Collaborator

@mmisol mmisol left a comment

Choose a reason for hiding this comment

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

Thanks @QilongTang . This looks good to me

@QilongTang
Copy link
Contributor Author

Merging since all checks passing

@QilongTang QilongTang merged commit 7140c63 into master May 7, 2021
@QilongTang QilongTang deleted the ReturnDataForOpenXMLExportExcelNode branch May 7, 2021 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants