Skip to content

chore: tidy to_unicode() in compat.py #13740

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vparfait
Copy link
Contributor

@vparfait vparfait commented Jun 23, 2025

As part of APMAPI-1159 this is to replace code that supports < python 3.8.
Removing comments about the six library as those are outdated. six is a library to assist with python 2/3 compatibility.
Kept duck typing for future proofing and to support bytearray.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

@vparfait vparfait requested review from a team as code owners June 23, 2025 03:48
@vparfait vparfait added the changelog/no-changelog A changelog entry is not required for this PR. label Jun 23, 2025
Copy link
Contributor

CODEOWNERS have been resolved as:

ddtrace/internal/compat.py                                              @DataDog/python-guild @DataDog/apm-core-python

@vparfait vparfait force-pushed the vparfait/update_unicode_compat branch from 172725f to 3447253 Compare June 23, 2025 03:56
Copy link
Contributor

github-actions bot commented Jun 23, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 272 ± 2 ms.

The average import time from base is: 274 ± 2 ms.

The import time difference between this PR and base is: -2.69 ± 0.07 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 2.054 ms (0.76%)
ddtrace.bootstrap.sitecustomize 1.353 ms (0.50%)
ddtrace.bootstrap.preload 1.353 ms (0.50%)
ddtrace.internal.remoteconfig.client 0.663 ms (0.24%)
ddtrace 0.701 ms (0.26%)
ddtrace.internal._unpatched 0.058 ms (0.02%)
json 0.033 ms (0.01%)
json.decoder 0.033 ms (0.01%)
re 0.033 ms (0.01%)
enum 0.033 ms (0.01%)
types 0.033 ms (0.01%)
subprocess 0.026 ms (0.01%)
contextlib 0.026 ms (0.01%)

@pr-commenter
Copy link

pr-commenter bot commented Jun 23, 2025

Benchmarks

Benchmark execution time: 2025-06-24 07:50:22

Comparing candidate commit c22de04 in PR branch vparfait/update_unicode_compat with baseline commit 7f7f968 in branch main.

Found 0 performance improvements and 3 performance regressions! Performance is the same for 558 metrics, 3 unstable metrics.

scenario:iastaspects-format_map_aspect

  • 🟥 execution_time [+432.722ns; +484.959ns] or [+13.499%; +15.129%]

scenario:iastaspects-upper_aspect

  • 🟥 execution_time [+191.133ns; +236.113ns] or [+8.521%; +10.527%]

scenario:iastaspectsospath-ospathjoin_aspect

  • 🟥 execution_time [+822.481ns; +966.269ns] or [+13.401%; +15.744%]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants