Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
drop commented and never used method
Browse files Browse the repository at this point in the history
  • Loading branch information
gtema committed Jan 10, 2024
1 parent 0aa1583 commit 65f8059
Showing 1 changed file with 0 additions and 87 deletions.
87 changes: 0 additions & 87 deletions codegenerator/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,90 +479,3 @@ def parse_parameter(self, schema) -> RequestParameter:
raise NotImplementedError("Parameter %s is not covered yet" % schema)

raise RuntimeError("Parameter %s is not supported yet" % schema)

# def merge_models(self, side_a: list[ADT], side_b: list[ADT]) -> list[ADT]:
# results: list[ADT] = []
# for item_a in side_a:
# for item_b in side_b:
# if item_a == item_b:
# results.append(item_a)
# side_b.remove(item_b)
# break
# elif item_a.reference == item_b.reference:
# # Reference matches means we found modified model
# if not isinstance(item_a, Struct):
# raise NotImplementedError(
# f"Merging {type(item_a)} is not implemented"
# )
# if item_a.pattern_properties != item_b.pattern_properties:
# raise NotImplementedError(
# f"Merging object patternProperties is not implemented"
# )
# if item_a.additional_fields != item_b.additional_fields:
# raise NotImplementedError(
# f"Merging object additionalProperties is not implemented"
# )
# a_not_b = set(item_a.fields.keys()).difference(
# item_b.fields.keys()
# )
# b_not_a = set(item_b.fields.keys()).difference(
# item_a.fields.keys()
# )
# logging.debug(f"a not b {a_not_b}")
# logging.debug(f"b not a {b_not_a}")
# for field, data_type_a in item_a.fields.items():
# if field not in b_not_a:
# data_type_b = item_b.fields[field]
# if data_type_a != data_type_b:
# logging.debug(
# f"Found change in {data_type_a} vs {data_type_b}"
# )
# a = data_type_a.model_copy()
# a.min_ver = None
# a.max_ver = None
# b = data_type_b.model_copy()
# b.min_ver = None
# b.max_ver = None
# if a == b:
# logging.debug("Only MV changed")
# data_type_a.min_ver = ".".join(
# min(
# data_type_a.min_ver.split("."),
# data_type_b.min_ver.split("."),
# )
# )
# if (
# not data_type_a.max_ver
# or not data_type_b.max_ver
# ):
# data_type_a.max_ver = None
# else:
# data_type_a.max_ver = ".".join(
# max(
# data_type_a.max_ver.split("."),
# data_type_b.max_ver.split("."),
# )
# )
# continue
# if type(a.data_type) == type(b.data_type):
# # types are same
# a.data_type.format = None
# b.data_type.format = None
# if a == b:
# logging.debug("Field changed format. Ignoring...")
# continue
# raise NotImplementedError(
# "Structure field changes other then microversion are not suported"
# )

# print(field)
# for field in b_not_a:
# item_a.fields[field] = item_b.fields[field]
# results.append(item_a)
# side_b.remove(item_b)
# break

# # print(item_a)
# results.extend(side_b)
# print(results)
# return results

0 comments on commit 65f8059

Please sign in to comment.