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

deprecate output context metadata for definition_metadata #20198

Merged
merged 10 commits into from
Mar 20, 2024

Conversation

jamiedemaria
Copy link
Contributor

@jamiedemaria jamiedemaria commented Mar 1, 2024

Summary & Motivation

On OutputContext deprecate metadata and replace with definition_metadata. This allows us to more easily distinguish between definition and output metadata in #20091

Majority of this PR is changing callsites

How I Tested These Changes

Copy link
Contributor Author

jamiedemaria commented Mar 1, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @jamiedemaria and the rest of your teammates on Graphite Graphite


@public
@property
def definition_metadata(self) -> ArbitraryMetadataMapping:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took the opportunity to tighten up the typing for this property. definition_metadata will never be None (we always set it to an empty dictionary at minimum)

@@ -113,7 +121,10 @@ def __init__(
self._name = name
self._job_name = job_name
self._run_id = run_id
self._metadata = metadata or {}
normalized_metadata = normalize_renamed_param(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the result of normalize_renamed_param is assigned to its own var first bc pyright was complaining if i had it as

self._definition_metadata = normalize_renamed_param(definition_metadata, "definition_metadata", metadata, "metadata") or {}

@jamiedemaria jamiedemaria marked this pull request as ready for review March 4, 2024 20:03
@erinkcochran87 erinkcochran87 removed their request for review March 6, 2024 19:09
@jamiedemaria
Copy link
Contributor Author

@alangenfeld @smackesey bumping for review when you get the chance. not a high priority, but would be nice to not let it lag too much

@jamiedemaria jamiedemaria merged commit 3de20bb into master Mar 20, 2024
2 checks passed
@jamiedemaria jamiedemaria deleted the jamie/2-deprecate-metadata branch March 20, 2024 19:30
PedramNavid pushed a commit that referenced this pull request