Skip to content

chore(contrib): ensure core.dispatch is called with tuples#17960

Open
brettlangdon wants to merge 2 commits intomainfrom
brettlangdon/dispatch.contrib.typing
Open

chore(contrib): ensure core.dispatch is called with tuples#17960
brettlangdon wants to merge 2 commits intomainfrom
brettlangdon/dispatch.contrib.typing

Conversation

@brettlangdon
Copy link
Copy Markdown
Member

Description

Right now we do not type check ddtrace/contrib/. There are a handful of callsites which incorrect call core.dispatch with a list instead of tuple for the arguments.

This PR adds an ast-grep rule to look for this pattern, and it fixes all the existing incorrect callsites.

Testing

Risks

Additional Notes

@brettlangdon brettlangdon requested review from a team as code owners May 7, 2026 18:16
@brettlangdon brettlangdon added the changelog/no-changelog A changelog entry is not required for this PR. label May 7, 2026
@brettlangdon brettlangdon requested review from juanjux and quinna-h May 7, 2026 18:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 55f4ed152a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .sg/rules/core-dispatch-list-args-multi.yml
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

Codeowners resolved as

.sg/rules/core-dispatch-list-args-bare-multi.yml                        @DataDog/apm-core-python
.sg/rules/core-dispatch-list-args-bare-single.yml                       @DataDog/apm-core-python
.sg/rules/core-dispatch-list-args-multi.yml                             @DataDog/apm-core-python
.sg/rules/core-dispatch-list-args-single.yml                            @DataDog/apm-core-python
.sg/tests/__snapshots__/core-dispatch-list-args-bare-multi-snapshot.yml  @DataDog/apm-core-python
.sg/tests/__snapshots__/core-dispatch-list-args-bare-single-snapshot.yml  @DataDog/apm-core-python
.sg/tests/__snapshots__/core-dispatch-list-args-multi-snapshot.yml      @DataDog/apm-core-python
.sg/tests/__snapshots__/core-dispatch-list-args-single-snapshot.yml     @DataDog/apm-core-python
.sg/tests/core-dispatch-list-args-bare-multi-test.yml                   @DataDog/apm-core-python
.sg/tests/core-dispatch-list-args-bare-single-test.yml                  @DataDog/apm-core-python
.sg/tests/core-dispatch-list-args-multi-test.yml                        @DataDog/apm-core-python
.sg/tests/core-dispatch-list-args-single-test.yml                       @DataDog/apm-core-python

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented May 7, 2026

Benchmarks

Benchmark execution time: 2026-05-07 18:38:42

Comparing candidate commit 55f4ed1 in PR branch brettlangdon/dispatch.contrib.typing with baseline commit 97ddb77 in branch main.

Found 0 performance improvements and 5 performance regressions! Performance is the same for 590 metrics, 4 unstable metrics.

scenario:iastaspects-lstrip_aspect

  • 🟥 execution_time [+75.508µs; +84.577µs] or [+27.680%; +31.004%]

scenario:iastaspects-repr_aspect

  • 🟥 execution_time [+52.083µs; +62.219µs] or [+16.234%; +19.393%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+92.951µs; +101.677µs] or [+21.932%; +23.991%]

scenario:span-start

  • 🟥 execution_time [+1.134ms; +1.295ms] or [+7.233%; +8.255%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+185.660ns; +225.741ns] or [+8.960%; +10.894%]

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.

1 participant