coderaanalytics / econdatar

R package for uploading and downloading data to/from www.econdata.co.za
MIT License
6 stars 2 forks source link

Error when manually specifying `release` parameter in `write_release()` #18

Closed aidanhorn closed 4 months ago

aidanhorn commented 8 months ago

Could you please check that the release parameter in write_release() does not have a bug? I was releasing a dataset more than an hour late, so I tried setting the release string manually. It gave the following error, so I left out the parameter the second time, and that released successfully.

> write_release(agencyid = "ECONDATA",
+               id = "MANUFACTURING",
+               version = "1.1.0",
+               description = "Nov 2023 (2024-01-11)",
+               release = "2024-01-11T13:00:00")
Committing release: ECONDATA-MANUFACTURING-1.1.0

Error in write_release(agencyid = "ECONDATA", id = "MANUFACTURING", version = "1.1.0",  :
  Error in #object[econdata.handler.dataset$stage_release 0x837cdce "econdata.handler.dataset$stage_release@837cdce"]org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "obs_series_id_time_period_created_key"
  Detail: Key (series_id, time_period, created)=(9701, 2001-11-01, 2024-01-11 13:00:00+00) already exists.NULL    

> write_release(agencyid = "ECONDATA",
+               id = "MANUFACTURING",
+               version = "1.1.0",
+               description = "Nov 2023 (2024-01-11)")
Committing release: ECONDATA-MANUFACTURING-1.1.0

Data set release successfully committed.
> packageVersion("econdatar")
2.0.4
aidanhorn commented 7 months ago

Am I able to test this without it being in production?

aidanhorn commented 7 months ago

@Jacques-rs could you try manually write the release timestamp, and description, if an automated process fails? Just so that this issue can be tested. I don't load many dataflows, but the QLFS would be coming up.

byrongibby commented 4 months ago

This is a valid error, it states that you are trying to release the data set with the same release date/time as the previous release.