Skip to content

Conversation

@lars-petter-hauge
Copy link
Collaborator

@lars-petter-hauge lars-petter-hauge commented Nov 17, 2025

solves: #488

We don't know the version until the model has run (as it can change dynamically), hence we put it on the SimulationResult. Slight awkward that e.g. model_id and model_version are attached to two different pydantic objects (only mapped through Simulation_id), but that's perhaps something we need to live with.


return (
<>
<Typography>{simulationResults.modelVersion}</Typography>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not ment to be like this, was just to showcase that it works

@lars-petter-hauge
Copy link
Collaborator Author

Happy to see the tests are failing (with sensible error) without any migration setup!

self = <sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2 object at 0x7f0584d2fec0>
cursor = <cursor object at 0x7f0585f5d990; closed: -1>
statement = 'INSERT INTO results (simulation_id, model_version, concentrations, panels, python_exception, error, id, created_at, u...ncentrations)s::JSON, %(panels)s::JSON, %(python_exception)s, %(error)s, %(id)s::UUID, %(created_at)s, %(updated_at)s)'
parameters = {'concentrations': '{}', 'created_at': datetime.datetime(2025, 11, 17, 15, 21, 3, 327652), 'error': "'tuple' object has no attribute 'model_version'", 'id': UUID('19828f44-4aae-4502-bdf9-550e76ca8cba'), ...}
context = <sqlalchemy.dialects.postgresql.psycopg2.PGExecutionContext_psycopg2 object at 0x7f0584d2e4e0>

    def do_execute(self, cursor, statement, parameters, context=None):
>       cursor.execute(statement, parameters)
E       psycopg2.errors.UndefinedColumn: column "model_version" of relation "results" does not exist
E       LINE 1: INSERT INTO results (simulation_id, model_version, concentra...

@lars-petter-hauge lars-petter-hauge force-pushed the add_version branch 4 times, most recently from c6488b1 to b552fce Compare November 19, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants