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

Data node Viewer - Add file download/upload capability for file based data nodes #1196

Open
jrobinAV opened this issue Apr 17, 2024 · 4 comments
Labels
Core: Data node 🖰 GUI Related to GUI 📈 Improvement Improvement of a feature. 🟧 Priority: High Must be addressed as soon 🔒 Staff only Can only be assigned to the Taipy R&D team

Comments

@jrobinAV
Copy link
Member

jrobinAV commented Apr 17, 2024

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 from the data node viewer easily.

This should help the end user understand its data, particularly when data is corrupted or an unexpected behavior happens.

This capability could be enabled/disabled by the developer through a property. By default, it should be enabled.

Proposal

  1. The download could be accessible through a "Download" button (eventually, an icon when the element width is too small).
  2. The upload could be accessible through an "Upload" file selector (eventually, an icon when the element width is too small). When a file is passed to the Upload mechanism, Taipy should:
    • Check the file (a check property should let the developer provide a custom function).
    • Write the file at the data node path location. Eventually, overwrite it if a file already exists.
    • track the data node edition

Usage

def custom_check(state, file_path) -> bool:
    # Apply the check logic
    return True


<| {selected_datanode} | datanode | file_download=false | file_upload=true | upload_check=custom_check |>
@jrobinAV jrobinAV added 📈 Improvement Improvement of a feature. 🖰 GUI Related to GUI Core: Data node labels Apr 17, 2024
@FlorianJacta
Copy link
Member

Seems related to this #427

@jrobinAV jrobinAV added the 🟨 Priority: Medium Not blocking but should be addressed label Apr 26, 2024
@jrobinAV jrobinAV added 🟧 Priority: High Must be addressed as soon 🔒 Staff only Can only be assigned to the Taipy R&D team and removed 🟨 Priority: Medium Not blocking but should be addressed labels May 3, 2024
@jrobinAV jrobinAV changed the title Data node Viewer - Add file download capability for file based data nodes Data node Viewer - Add file download/upload capability for file based data nodes May 13, 2024
@trgiangdo
Copy link
Member

There are a few use-cases I think we need to clarify before actually implement the feature. I will only mainly on the Core side of the problem here, and error handling on GUI as well.

  1. If the datanode is not file-based, what happens?

    • Raise an error on the GUI component directly? (not sure if it's possible), or
    • Notify an error from Core to GUI
  2. For most file-based datanodes, we can return the file or folder directly when downloading. But on ExcelDataNode, what if the DataNode can only access a few sheets of the file, we return the original file or a new file with only the defined sheets?

  3. For uploading data, how do we handle invalid data?

    • We can check for the data before writing,
    • Or better yet, we can try to write the data and catch any exception to raise an error.
    • However, most issues related to wrong data will only be raised when executing jobs, so it's hard to detect the problem at uploading step.

@FlorianJacta
Copy link
Member

  1. Make the button inactive.
  2. I would guess the new file (not sure)
  3. I would say it is on the developer side, not ours. Make sure their tasks are compliant with invalid data or do the right transformation.

@jrobinAV
Copy link
Member Author

These are good questions.

  1. I agree with @FlorianJacta. We simply deactivate the button.
  2. Good question. What I had in mind originally was just asking the data node path to Core, and then simply download the file, without any preprocessing.
    If we need to go through the read method to understand what should be exported, the functionality is not the same. In this case, I believe a table export feature to export the content of a table is more suitable and could apply to SQL data nodes as well.
  3. Here again I was originally thinking of a simple file replacement. That means the responsibility is on our users.
    The end-user: The end user should take the responsibility to ensure the validity of the data. We can imagine adding an info message (like a mouseover text or something else) to let him know that he is responsible for checking the file format (pickle, excel, csv) and eventually the data format (column names). This message could be specific to each data node type.
    The developer: We should expose a way for the developer to pass a checker method to the control. THe checker can validate the file content once uploaded. If the checker passes the file can be replaced.

@MariahLeone Any thoughts about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core: Data node 🖰 GUI Related to GUI 📈 Improvement Improvement of a feature. 🟧 Priority: High Must be addressed as soon 🔒 Staff only Can only be assigned to the Taipy R&D team
Projects
None yet
Development

No branches or pull requests

3 participants