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

DM-33155: Change how task metadata storage class is chosen #223

Merged
merged 5 commits into from Jan 11, 2022

Conversation

timj
Copy link
Member

@timj timj commented Jan 7, 2022

  • Add TaskMetadata.to_dict() method (this is now used by the PropertySet.from_mapping() method and triggered by the butler if type conversion is needed).
  • Use the existing metadata storage class definition if one already exists.
  • Switch Task to use TaskMetadata rather than PropertySet

Requires lsst/daf_butler#626 and lsst/daf_base#72

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

The dict() method converts it to the internal model form
of the class with distinct sections for scalars, arrays,
and metadata. The to_dict() method looks like something
the user would expect the content to look like.
Previously the task_metadata storage classes use a definition
that matches the metadata python type attached to the Task.
Butler can now do type conversion on put and get so prefer
a metadata storage class that matches the current definition.
New metadata dataset types will use the default.

This allows old registries to use old dataset type definitions
without having to migrate them all but still allow Task
to use updated metadata class.
No longer use PropertySet by default.
Now that TaskMetadata can be converted to PropertySet there
is no need for Task to support both.
@timj
Copy link
Member Author

timj commented Jan 10, 2022

@TallJimbo I realized that there is no need to continue to support the PropertySet switch at the top of the file so I removed that code.

@timj timj merged commit bf0e57e into main Jan 11, 2022
@timj timj deleted the tickets/DM-33155 branch January 11, 2022 17:29
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.

None yet

2 participants