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.
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
feat: export tagged library as csv (TEMP) #628
feat: export tagged library as csv (TEMP) #628
Changes from 10 commits
f84abd0
06810a2
f750076
f637076
3cf462f
aa93510
e94131f
9a1729d
6518a91
8ddf875
663feed
95b3e88
ed547be
df06d9a
a153ec9
610c01a
4012481
4d1d82d
6353bb2
4ad87c2
5caf952
df13345
b6366b6
e6a0dce
aa38f08
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up here we can decide which method to use when fetching child blocks, so we don't have to do the type checks in the loop below:
But you'll need to remove the
store
parameter fromget_xblock_tagged_object_and_children
and just call this again (it's ok to do this, the modulestore is globally cached):There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we can use the
get_tagged_children
variable set in my suggestion above:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: 610c01a
At first, I thought we would still need a type guard before calling the function,
but the types were inferred just right.The code is way cleaner now! Thank you!
Edit: My lsp didn't found any issues but our static type checker didn't like it. It uses the first variable assignment to define the type:
I did an explicit typing here: 4012481
Not pretty, but I think it is better than disable the type checking. Do you know a better way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpenido sorry, I don't know a better way to do this.. but I agree, having an ugly type definition is better than disabling type checking.