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

Marking move from one component type to another one as impossible for schema evolution #622

Merged
merged 5 commits into from
Jun 14, 2024

Conversation

hegner
Copy link
Collaborator

@hegner hegner commented Jun 10, 2024

BEGINRELEASENOTES

  • Detect more impossible schema evolutions
  • Improving printout of schema evolution checker
    ENDRELEASENOTES

This addresses #563

@hegner hegner requested a review from tmadlener June 10, 2024 21:13
Copy link
Collaborator

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

This turned out to be a slightly simpler change than what I would have imagined :).

@hegner
Copy link
Collaborator Author

hegner commented Jun 11, 2024

This turned out to be a slightly simpler change than what I would have imagined :).

Probably speaks for the design for once :-D

@tmadlener tmadlener linked an issue Jun 11, 2024 that may be closed by this pull request
Copy link
Collaborator

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

There seems to be an unrelated error that currently makes the script fail when trying to run it on the edm4hep.yaml file that triggered the original issue:

Traceback (most recent call last):
  File "/home/tmadlener/work/AIDASoft/podio/python/podio_schema_evolution.py", line 476, in <module>
    comparator.compare()
  File "/home/tmadlener/work/AIDASoft/podio/python/podio_schema_evolution.py", line 184, in compare
    self._compare_components()
  File "/home/tmadlener/work/AIDASoft/podio/python/podio_schema_evolution.py", line 196, in _compare_components
    [
  File "/home/tmadlener/work/AIDASoft/podio/python/podio_schema_evolution.py", line 197, in <listcomp>
    AddedComponent(self.datamodel_new.components[name], name)
  File "/home/tmadlener/work/AIDASoft/podio/python/podio_schema_evolution.py", line 34, in __init__
    super().__init__(f"'{self.component.name}' has been added")
AttributeError: 'dict' object has no attribute 'name'

The issue is here:

super().__init__(f"'{self.component.name}' has been added")

it should be self.name instead of self.component.name to make things work again. With that fix the script detects invalid schema changes in the EDM4hep yaml file.

Can we add a simple test that at least runs the script on the example datamodel(s) that we have?

@hegner
Copy link
Collaborator Author

hegner commented Jun 11, 2024

Can we add a simple test that at least runs the script on the example datamodel(s) that we have?

Surprised we didn't have. This PR or a new one?

@tmadlener
Copy link
Collaborator

Yeah, I also thought we had one, but at least I couldn't find one. Or if we have one at least it didn't trigger this issue. I would prefer a new PR.

@hegner
Copy link
Collaborator Author

hegner commented Jun 11, 2024

We only had for the C++ part it seems. OK. new ticket, new PR

@tmadlener
Copy link
Collaborator

PR to fix the bug in the schema evolution generation: #627

@hegner
Copy link
Collaborator Author

hegner commented Jun 12, 2024

other PR merged now

@tmadlener
Copy link
Collaborator

Can you rebase this quickly to pick up those changes?

@hegner
Copy link
Collaborator Author

hegner commented Jun 12, 2024

obviously that fails now ;-) need to change the test definition

Copy link
Collaborator

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

Works for me. Ideally we could condense down the test for a failing schema evolution a bit rather than having the third copy of the datamodel effectively, but we can also postpone that to after v1.0

@hegner
Copy link
Collaborator Author

hegner commented Jun 14, 2024

for post v1 we could do that a bit separated without a file, but in pure python tests. I will merge now.

@hegner hegner merged commit 3ee8997 into AIDASoft:master Jun 14, 2024
18 checks passed
@hegner hegner deleted the schema_fix branch June 16, 2024 17:30
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.

Schema evolution script does not flag some evolutions as impossible
2 participants