-
Notifications
You must be signed in to change notification settings - Fork 23
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
Added an enhancement - issue 366 to add a download all if no argument… #371
Conversation
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.
Looking good! Need to change a thing though.
Also apologies for not writing this anywhere like a CONTRIBUTING.md (we should probably set up one), but we use black to format the code.
|
||
# If no fields are specified, include all blob fields from self.datasource.fields | ||
if not fields: | ||
fields = [field.name for field in self.datasource.fields if field.is_blob()] |
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.
There is no is_blob()
function on the MetadataFieldSchema
enum.
You can either add this function, or compare to MetadataFieldType.BLOB in the comprehension
fields = [field.name for field in self.datasource.fields if field.is_blob()] | |
fields = [field.name for field in self.datasource.fields if field.valueType == MetadataFieldType.BLOB] |
Don't forget to import MetadataFieldType, I don't think it's imported in QueryResult.
…matted using python black.
hi @kbolashev Kindly please review. I added and chaged the valeu as requested and added an import |
Thank you so much @rabroldan ! I'll make sure to add it to Really sorry for the last minute inconenience :P |
Ok I reran it and resolved the merge conflict, should be able to merge it now. |
hey @kbolashev i jsut saw the request. but it seemed you already did it, thank you for allowing me to contribute on this project. i'll keep an eye on some of the issue and see if i can get a few more done. |
This updated version automatically gets all blob fields from self.datasource.fields and adds them to the list of fields that will be downloaded if the fields argument is empty. As a result, the function will by default download all of the blob's fields if we don't specify any specific fields as parameters.
Adding an
if condition
to add the code that set the fieldsKindly please rake a look thank you