SolarArbiter / solarforecastarbiter-api

HTTP API and database schema for the Solar Forecast Arbiter
https://api.solarforecastarbiter.org
MIT License
10 stars 6 forks source link

Site/Aggregate foreign key constraint IntegrityError #180

Closed lboeman closed 4 years ago

lboeman commented 4 years ago

Posting the metadata of an obs/fx/cdf with valid UUID that does not exist in storage results in a MYSQL Integrity Error. Perhaps this should just be added to the error code check in sfa_api.utils.storage_interface.try_query

mysql error code is 1216

lboeman commented 4 years ago

Very confused as to how I was hitting this error, it appears to be tested. with test_forecast_post_invalid_site_id and test_forecast_post_invalid_aggregate. Will have to look into this further. The site_id in question was a valid aggregate_id, so that may be the culprit.