Error on min_date_allowed "min() arg is an empty sequence"

Hi,

Iam making a Dashboard to visualise information from databases.
Not all the databases containing the same info.
Now i am facing a problem when some info is missing and some dataframes will be empty.
I have the following Div, and because the “df[‘date’]” is empyt he comes a error message “min() arg is an empty sequence”

Is there a way to give it a default value when empty?

Hope somebody can help

Heres the DIV:

html.Div (
                        [
                            dcc.DatePickerRange (
                                id='df_date',
                                start_date_placeholder_text="Start Date",
                                end_date_placeholder_text="End Date",
                                min_date_allowed=min (df['date']),
                                max_date_allowed=max (df['date']),
                                start_date=min (df['date']),
                                end_date=max (df['date']),
                                initial_visible_month=max (df['date']),
                            ),  # standaard waarde "All data"

                        ])

Kind regards

So you have a problem with this because you are starting without a dataframe and then plan to upload one later?
In that case you can just initiate the Div with standard values you fill in, and create a callback, that takes the uploaded dataframe as an input and has min_date_allowed, max_date_allowed, etc. as an output.