From 6f2dabb9c42ad6329aec55b2c0a926d483f45832 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 1 Sep 2026 16:00:46 -0400 Subject: [PATCH] fix: take the upstream EDM into account when reading old schemas _read_old_schemas re-reads the current and the old datamodel definitions through a fresh PodioConfigReader in order to compare them, but did not pass the upstream EDM along. Validation of the freshly read models then cannot resolve any type coming from the upstream EDM and code generation fails with e.g. DefinitionError: position of component edm4eic::TrackPoint is not a builtin type, another component or one from the upstream EDM This makes OLD_DESCRIPTIONS unusable for any datamodel that is built on top of an upstream EDM. The comparison itself never needs the upstream components, it is only the validation of the re-read models that trips over them, so simply passing the upstream EDM along is enough. Assisted-by: Claude Opus 5 --- python/podio_gen/cpp_generator.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python/podio_gen/cpp_generator.py b/python/podio_gen/cpp_generator.py index 01c2b6545..265128c27 100644 --- a/python/podio_gen/cpp_generator.py +++ b/python/podio_gen/cpp_generator.py @@ -664,13 +664,20 @@ def _read_old_schemas(self): reader = PodioConfigReader() # Read the current model again into a "new" namespace to have it more # easily discerned from the "old" model - datamodel_new = reader.read(self.yamlfile, package_name="new") + datamodel_new = reader.read( + self.yamlfile, package_name="new", upstream_edm=self.upstream_edm + ) comparator = DataModelComparator(datamodel_new) judge = SchemaEvolutionJudge(comparator.datamodel_new, evolution_file=self.evolution_file) # Process each old schema version for old_yamlfile in self.old_yamlfiles: - datamodel_old = reader.read(old_yamlfile, package_name="old", ignore_extracode=True) + datamodel_old = reader.read( + old_yamlfile, + package_name="old", + upstream_edm=self.upstream_edm, + ignore_extracode=True, + ) detected_changes = comparator.compare(datamodel_old) comparison_results = judge.judge(datamodel_old, detected_changes)