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

Update ReadableSpan.to_json indent argument type #3790

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hennie-the-barbarian
Copy link

Description

Changed the type of the indent argument in ReadableSpan to match the type signature of json.dumps, since indent is simply being passed through to json.dumps

Fixes # N/A

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

TBD as it's a simple change

  • Test that if fixes linting when passing an indent value of None to to_json

Does This PR Require a Contrib Repo Change?

No

Answer the following question based on these examples of changes that would require a Contrib Repo Change:

  • The OTel specification has changed which prompted this PR to update the method interfaces of opentelemetry-api/ or opentelemetry-sdk/

  • The method interfaces of test/util have changed

  • Scripts in scripts/ that were copied over to the Contrib repo have changed

  • Configuration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in

    • pyproject.toml
    • isort.cfg
    • .flake8
  • When a new .github/CODEOWNER is added

  • Major changes to project information, such as in:

    • README.md
    • CONTRIBUTING.md
  • Yes. - Link to PR:

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Copy link

linux-foundation-easycla bot commented Mar 19, 2024

CLA Signed

  • ✅login: hennie-the-barbarian / (8779b01)

The committers listed above are authorized under a signed CLA.

@rbtz-openai
Copy link
Contributor

  1. The current target python version is 3.8, you'll need to use Optional until we switch to something that supports https://peps.python.org/pep-0604/
  2. There are a lot of to_json functions around the codebase, which all currently share the same signature, which makes it "kind of" an interface, so I would say it should be a "none or all" type of a change.

I'm not a maintainer, so take it with a grain of salt.

@@ -462,7 +462,7 @@ def instrumentation_info(self) -> Optional[InstrumentationInfo]:
def instrumentation_scope(self) -> Optional[InstrumentationScope]:
return self._instrumentation_scope

def to_json(self, indent: int = 4):
def to_json(self, indent: int|None = 4):
Copy link
Contributor

Choose a reason for hiding this comment

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

The codebase uses Optional[int]

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.

3 participants