Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docker-jans-persistence-loader): handle missing data type for overriden column #8392

Merged
merged 4 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docker-jans-persistence-loader/scripts/spanner_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def get_data_type(self, attr, table=None):

type_ = type_def.get(self.client.dialect)

if not type_:
continue

if table in type_.get("tables", {}):
type_ = type_["tables"][table]

Expand Down
3 changes: 3 additions & 0 deletions docker-jans-persistence-loader/scripts/sql_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def get_data_type(self, attr, table=None):

type_ = type_def.get(self.client.dialect) or type_def["mysql"]

if not type_:
continue

if table in type_.get("tables", {}):
type_ = type_["tables"][table]

Expand Down
10 changes: 5 additions & 5 deletions docker-jans-persistence-loader/scripts/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,10 @@ def update_scripts_entries(self):
else:
props = agama_entry.attrs["jansConfProperty"]

if self.backend.type != "couchbase":
# try converting to mapping
props = [json.loads(prop) for prop in props]
if not isinstance(props, list):
props = [props]

props = [json.loads(prop) for prop in props]

# filter out unwanted properties
new_props = [
Expand All @@ -380,8 +381,7 @@ def update_scripts_entries(self):
]

if new_props != props:
if self.backend.type != "couchbase":
new_props = [json.dumps(prop) for prop in new_props]
new_props = [json.dumps(prop) for prop in new_props]

if self.backend.type == "sql" and self.backend.client.dialect == "mysql":
agama_entry.attrs["jansConfProperty"]["v"] = new_props
Expand Down
Loading