taipy icon indicating copy to clipboard operation
taipy copied to clipboard

[๐Ÿ› BUG] Error when aggregating a table with a date column

Open FlorianJacta opened this issue 1 year ago โ€ข 2 comments

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

  • [ ] Ensure new code is unit tested, and check code coverage is at least 90%.
  • [ ] Create related issue in taipy-doc for documentation and Release Notes.

Code of Conduct

  • [X] I have checked the existing issues.
  • [ ] I am willing to work on this issue (optional)

FlorianJacta avatar Oct 09 '24 15:10 FlorianJacta

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

rabelmervin avatar Oct 11 '24 04:10 rabelmervin

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!

FlorianJacta avatar Oct 11 '24 08:10 FlorianJacta

Fixed in 4.0.1.dev1 :tada:

AlexandreSajus avatar Nov 07 '24 09:11 AlexandreSajus