Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
14.43k stars 1.75k forks source link

[🐛 BUG] Error when aggregating a table with a date column #1994

Open FlorianJacta opened 1 week ago

FlorianJacta commented 1 week ago

What went wrong? 🤔

Aggregation in a Taipy table raises an error when there is a date column inside the table.

image

This worked in 3.1 but not anymore in 4.0.

Nothing shown on the Python console.

Client console:

taipy-gui-deps.dll.js?09280cf3a6e7afe74927:184 TypeError: Cannot read properties of undefined (reading 'dfid')
    at taipy-gui.js?09280cf3a6e7afe74927:184:117165
    at Array.reduce (<anonymous>)
    at xV (taipy-gui.js?09280cf3a6e7afe74927:184:117132)
    at taipy-gui.js?09280cf3a6e7afe74927:184:172564
    at hl (taipy-gui-deps.dll.js?09280cf3a6e7afe74927:184:554395)
    at jr (taipy-gui-deps.dll.js?09280cf3a6e7afe74927:184:574340)
    at taipy-gui-deps.dll.js?09280cf3a6e7afe74927:184:573117
    at Ar (taipy-gui-deps.dll.js?09280cf3a6e7afe74927:184:573177)
    at lr (taipy-gui-deps.dll.js?09280cf3a6e7afe74927:184:566993)
    at Na (taipy-gui-deps.dll.js?09280cf3a6e7afe74927:184:508021)

Expected Behavior

We should be able to aggregate the table even if there is a date column inside the table.

Steps to Reproduce Issue

Run this code and aggregate on Country in the table:

from taipy.gui import Gui
import taipy.gui.builder as tgb
import pandas as pd

data = pd.DataFrame(
    {
        "Country": ["France", "France", "UK", "UK"],
        "Date": ["2020-01-01", "2020-01-02", "2020-01-03", "2020-01-04"],
    }
)
data["Date"] = pd.to_datetime(data["Date"])

with tgb.Page() as page:
    tgb.table(
        "{data}",
        group_by__Country=True,
    )

if __name__ == "__main__":
    Gui(page=page).run(title="Date Aggregation")

Version of Taipy

4.0

Acceptance Criteria

Code of Conduct

rabelmervin commented 1 week ago

Hi @FlorianJacta I'm interested to contribute to this issue ? Could you please assign me ?

FlorianJacta commented 1 week ago

This is not yet open for contribution. You can look into our other issues for the moment. We will let you know when this issue is open for contribution!