ARPA-SIMC / dballe

Fast on-disk database for meteorological observed and forecast data.
Other
19 stars 6 forks source link

Method to delete duplicates station from dballe #265

Closed bchiavarini closed 3 years ago

bchiavarini commented 3 years ago

Hi, we are having a problem with our local DBalle because we have some stations that have been duplicated by mistake and that are now rising selection station ID query returned 2 results error when data are imported using Python API

with db.transaction() as tr:
    tr.import_messages(msg, overwrite=True, update_station=True, import_attributes=True)

Is there a command to easily purge the database from these duplicated stations?

Thanks for your help

edigiacomo commented 3 years ago

Hi @bchiavarini, would it be possible to remotely connect to your database?

bchiavarini commented 3 years ago

i have already fixed the error deleting by hand the doubled stations from the db. But i am still interested, if it already exists, in finding a better method to fix such kind of error in case they happen again or in case they happen at a scale that is not manageable with the direct intervention on the single database rows.

spanezz commented 3 years ago

There is no such a method in dballe at the moment, mainly because there's never been a need for it. dballe should never duplicate stations, and to the best of my knowledge we haven't seen it happen in our production databases.

If it happens, I think the best thing would be to figure out how it happens, and for that I'd need access to a database where it happens, and information about what operations led it to be that way.

Rather than put effort in coding for a "feature" needed to recover after a recurring issue, I would put effort in understanding how the issue happens and on making it not happen

brancomat commented 3 years ago

@bchiavarini : some additional (and, hopefully, useful) informations:

I'm closing the issue, feel free to reopen it if you have more information about it (or more questions)

Thanks!