Closed jrobinAV closed 5 days ago
We now have new APIs on Filebased DataNode for download and upload.
_get_downloadable_path()
that returns the path to the downloadable data file, and an empty string if the path doesn't exist (in case the data node has no data).
This is so that the user can download the file. I'm not sure if this's enough for a Download button to work.
_upload(path, upload_checker)
that check the uploaded file and replace the current data file.
The idea is that when the user uploads a file, it will get stored somewhere. This _upload()
method receives the uploaded path, try to read it and check it using the optional upload_checker
method. If passes, the uploaded file will replace the file of the data node. If fails, a ReasonCollection is returned.
The upload_checker
should be a Python method that provided by the developer, that takes the file name of the upload data and the data itself as arguments, and return a boolean indicates whether the uploaded file is valid or not.
is there a Core API to know if a datanode is file based ? @jrobinAV @trgiangdo ?
@FredLL-Avaiga All data nodes based on a file are children of the _FileDataNodeMixin
FYI, today we have pickle, csv, excel, json, and parquet.
I would propose that the call to the user checker function would be surrounded by a try catch @jrobinAV @trgiangdo
https://vscode.dev/github/Avaiga/taipy/blob/develop/taipy/core/data/_file_datanode_mixin.py#L138
here is what I came up with
What do you think @jrobinAV @FabienLelaquais ?
of course with tooltips
Description When a data node is stored as a file, it would be handy for the end user to add a way to download or upload the file easily from the data node viewer.
This should help the end user understand its data, particularly when data is corrupted or an unexpected behavior happens.
The developer could enable/disable this capability through a property. By default, it should be enabled.
This issue is the GUI part of ticket #1196
Proposal
Usage