Skip to content

Commit

Permalink
Decode JSON before copying.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Jan 28, 2024
1 parent e6cfe4c commit 3b040dc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""
from datetime import datetime

import orjson
import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql import func
Expand Down Expand Up @@ -117,13 +118,14 @@ def upgrade():
"node_id": row[1],
"structure_id": structure_id,
"mimetype": row[3],
"parameters": row[4],
"parameters": orjson.loads(row[4]),
"management": row[5],
"time_created": datetime.fromisoformat(row[6]),
"time_udpated": datetime.fromisoformat(row[7]),
}
new_data_sources_rows.append(new_row)
unique_structures[structure_id] = row[2]
if structure_id not in unique_structures:
unique_structures[structure_id] = orjson.loads(row[2])
structures_rows = [
{"id": structure_id, "structure": structure}
for structure_id, structure in unique_structures.items()
Expand Down

0 comments on commit 3b040dc

Please sign in to comment.