Migration data marshalling headache

Dear all,

We’re migrating from dash 2.15 to 4.1, and dash-mantine from 0.12.1 to 2.6.1.

In the past, we can just use a Python integer as a value for a dropdown or AG-Grid, but now the browser is complaining unless we cast those integers to strings, explicitly.

I don’t know why it didn’t complain before. Maybe it has to do with dash-mantine components?

This created a huge headache for us since now we have to cast the integer keys from database to the UI, and cast them back when we store them back to the database.

Is there a smarter way to deal with this issue?

Thank you for your help!

Migrating from:
dash==2.15.0
dash-mantine-components==0.12.1
dash_ag_grid==31.0.1
Flask==2.2.5

Migrating to:
dash==4.1.0
dash-mantine-components==2.6.1
dash_ag_grid==35.2.0
Flask==3.1.3

Hi @aydevmo

There are a lot of breaking changes migrating from dmc 0.12.1 (which uses Mantine 5.10.5) to dmc 2.6.1 ( which uses Mantine 8.3.17) however, in both versions Mantine required that the value of the Select componets is a string. Can you give more information on the browser error? Mantine may have changed their error handing between version. Or maybe it’s from Ag Grid? Could you also give more information on the Ag Grid errors?

1 Like

Thank you @AnnMarieW for the quick response.

Now that I think it through, maybe the issue is in the dropdown component from Dash Mantine. I think it requires a string to be set as its selected value. (where dmc 0.12.1 is more flexible.)

For many pages, we feed this selected value to the AG-Grid. My next step is to cast this selected value to integer before it’s fed to the AG-Grid. I hope this can solve my own problem.

Thank you!

That should work, if the error is coming from Mantine.

An alternate is to use the dcc.Dropdown because it also supports numbers and boolean as values. The next major version Mantine (v9) also supports numbers and booleans, but it will be a while unitl that’s available in dmc because dash does not yet support React 19.

2 Likes

@AnnMarieW Thank you for the insight! I learned a thing or two today!

You are welcome!

Also, don’t hesitate to ask about any other migration issues for DMC. There were huge breaking changes going from dmc 0.12 to dmc .014 driven by changes to the upstream Mantine versions (but limited changes after that)

The migration guides after dmc 0.14 are very good, but the ones prior were not as comprehensive. I could help fill in some gaps if you run into any other issues.

1 Like

Thank you!@AnnMarieW
Actually, your code sample for the multi-page feature is the starting point of my project. In some way you’ve helped the market create one more job :slight_smile: (and thank all the other members in the Dash team!)

1 Like