OpenEnergyPlatform / oeplatform

Repository for the code of the Open Energy Platform (OEP) website. The OEP provides an interface to the Open Energy Family
http://openenergyplatform.org/
GNU Affero General Public License v3.0
61 stars 19 forks source link

Metadata is not always availabe for download even if visible in the database & metadata widget #1701

Closed jh-RLI closed 2 weeks ago

jh-RLI commented 2 weeks ago

Description of the issue

For some tables, the metadata cannot be downloaded, even if it is visible in the metadata widget (on the ‘Meta information’ tab on the table details page).

Steps to Reproduce

  1. https://openenergyplatform.org/dataedit/view/model_draft/ind_source_steel_coke
  2. Click Download metadata / look at https://openenergyplatform.org/api/v0/schema/model_draft/tables/ind_source_steel_coke/meta/
  3. You only see an empyt {}

Ideas of solution

Some time ago, we introduced a new approach to storing metadata. Previously, metadata was stored as an SQL comment to a table. Now the metadata is stored in the database (internal to django).

The metadata view (api) provides the GET method to retrieve the metadata, but the code still fetches the metadata from the comment-on table. We still store it there as we have decided to keep the bot memory for some time. In some cases (when no cursor is passed) the metadata is not stored as a comment in the table. This leads to the current problem.

We always have to retrieve the metadata from the database.

Context and Environment

Workflow checklist