RMI-PACTA / app

API + web frontend for PACTA infrastructure
MIT License
2 stars 0 forks source link

Enable Duplicate Reports by changing Blob URI scheme #148

Open gbdubs opened 8 months ago

gbdubs commented 8 months ago

{"error": "failed to perform operation: creating blob: creating blob row: ERROR: duplicate key value violates unique constraint \"blob_blob_uri_key\" (SQLSTATE 23505)"}

bcspragu commented 8 months ago

I'd imagine this happens when running an report twice on the same portfolio? IIRC, the blob URI is something like az://reports/<portfolio UUID>/<assets...>

gbdubs commented 8 months ago

Oh, can we change that? We will need to be able to run reports multiple times, specifically thinking portfolios with different properties (ESG ex), or pacta versions.

On Fri, Jan 19, 2024, 10:13 AM Brandon Sprague @.***> wrote:

I'd imagine this happens when running an report twice on the same portfolio? IIRC, the blob URI is something like az://reports/<portfolio UUID>/

— Reply to this email directly, view it on GitHub https://github.com/RMI-PACTA/app/issues/148#issuecomment-1900787698, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBXTLP2SH7OPW2RH5JN7BDYPKSSPAVCNFSM6AAAAABCBHOUDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBQG44DONRZHA . You are receiving this because you authored the thread.Message ID: @.***>

bcspragu commented 8 months ago

Totally, it's just this:

https://github.com/RMI-PACTA/app/blob/b743bc960caeb7be6a5b061f3ed301c46dd553e2/cmd/runner/main.go#L478-L479

The create_report.R script just outputs to a directory based on the input portfolio name, and we then just use that directly to create the subdir we upload the report to, but it can be set to whatever