Skip to content

Return none for Getter if key does not exist#1449

Merged
lzchen merged 9 commits intoopen-telemetry:masterfrom
lzchen:prop
Dec 8, 2020
Merged

Return none for Getter if key does not exist#1449
lzchen merged 9 commits intoopen-telemetry:masterfrom
lzchen:prop

Conversation

@lzchen
Copy link
Copy Markdown
Contributor

@lzchen lzchen commented Dec 4, 2020

Fixes #1274

@lzchen lzchen requested review from a team, codeboten and hectorhdzg and removed request for a team December 4, 2020 16:56
Copy link
Copy Markdown
Member

@hectorhdzg hectorhdzg left a comment

Choose a reason for hiding this comment

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

LGTM

) -> typing.Optional[typing.List[str]]:
val = carrier.get(key, None)
if val is None:
return None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this tested anywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added

Copy link
Copy Markdown
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Just a question around testing, otherwise this looks pretty good.

Copy link
Copy Markdown
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Nice!

@lzchen lzchen merged commit 780a782 into open-telemetry:master Dec 8, 2020
@lzchen lzchen deleted the prop branch December 8, 2020 15:02
codeboten pushed a commit to codeboten/opentelemetry-python that referenced this pull request Dec 8, 2020
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.

"GET" function in propagators should return None if nothing is found

3 participants