Skip to content

Transition plan for consumers of the new flat format parameter_value #541

@suvayu

Description

@suvayu

During the last dev call, the question of how to transition the internal consumers of parameter_value came up. While my initial response was to manage it by documenting compatibile versions of the spine packages, after some thought, I think we can do better in terms of easing development effort.

Background

DB / Client API old new
old
new

As it is implemented in #539, code to read the old DB can coexist with the new. So I think if we can make the case of using new client API with old DB possible, the development effort of updating all client APIs, can happen incrementally, without it, it will have to be all-or-nothing.

Proposal

We can add an optional flag to arrow_value.from_database, say, force_new=False; when set to true, an old DB parameter_value will be processed with the migration code from compat (make_records + convert_records_to_columns + to_array) before being converted to pyarrow as it would be for a new format DB. There will be a constant performance penalty.

This should change the ❓ above to ✅, and the development effort can be incremental. Once all client APIs have been migrated, we can force a DB migration. Until then advanced users can manually migrate the DB and test it by using spinedb_api from scripts.

Additional remark

  • Using the new DB with old client API is not possible.
  • We also need to implement a Julia client API in SpineInterface. Based on this discussion, it should be relatively straightforward to parse the new flat format to existing structures defined by SpineInterface.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions