earthpulse / eotdl

Earth Observation Training Datasets
https://eotdl.com
MIT License
17 stars 6 forks source link

Created dates in UI not showing correct data #140

Closed juansensio closed 2 months ago

juansensio commented 7 months ago

The Creation dates of datasets/models in the UI is not correct, some issue regarding the creation date may be happening.

earthpulse commented 5 months ago

Maybe a problem with the date set in the production environment?

achtsnits commented 5 months ago

do you have an example? for us it shows "Created 3 months ago" and similar...

juansensio commented 5 months ago

I will upload a dataset and share in Discord the dates.

achtsnits commented 4 months ago

created shows some day offset, updated seems to be correct?!?

juansensio commented 3 months ago

It looks like so... the code that creates a dataset can be found here.

As you can see, the creation date is not set and it is using the default value set by pydantic here.

Just created a dataset and I can see a shift of 3 hours (the updatedAt is the correct date).

Captura de pantalla 2024-03-14 a las 15 26 40

Again, running the API locally works just fine but for some reason in the production environment there is that offset. Any ideas?

achtsnits commented 3 months ago

we just checked

there is no shift - it obviously uses the startup time of the process (at the moment 15d ago)

image
achtsnits commented 3 months ago

createdAt: datetime = datetime.now() is not correct in https://github.com/earthpulse/eotdl/blob/main/api/api/src/models/dataset.py

see https://stackoverflow.com/questions/71512035/how-should-i-specify-default-values-on-pydantic-fields-with-validate-always-to/71512493#71512493

thanks @totycro for example

juansensio commented 2 months ago

Thanks. Changes are applied and working fine.