Skip to content

Ensure dtypes of Parameter data are handled consistently on IXMP4Backend #618

@glatterf42

Description

@glatterf42

As described by @khaeru on Slack (not public), it may be that ixmp4 Parameter data/dicts return different object types than the same data stored in JDBC. In particular, passing an empty "value" might be identified as type object on ixmp4, whereas JDBC always sets this as float:

ixmp/ixmp/backend/jdbc.py

Lines 1032 to 1040 in c07d3f3

# Prepare dtypes for additional columns
if type == "par":
columns.extend(["value", "unit"])
dtypes.update(value=float, unit=str)
# Same as above
# dtypes['unit'] = CategoricalDtype(self.jobj.getUnitList())
elif type in ("equ", "var"):
columns.extend(["lvl", "mrg"])
dtypes.update(lvl=float, mrg=float)

I'm not sure whether that changed in the meantime (originally, the comment was made in May), so the first step is to check whether this still exists and should be resolved.

If we want to resolve it, I'm not sure whether this should be ixmp4's task (because that is storing the data, after all), or IXMP4Backend's task (because that's supposed to ensure compatibility).

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting infoNeeds more information from the issuer to continue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions