Skip to content

Rename constant conflicting with built-in type: Hash#5804

Merged
Strech merged 2 commits into
masterfrom
rename-quantization-hash-constant
May 28, 2026
Merged

Rename constant conflicting with built-in type: Hash#5804
Strech merged 2 commits into
masterfrom
rename-quantization-hash-constant

Conversation

@marcotc
Copy link
Copy Markdown
Member

@marcotc marcotc commented May 22, 2026

Title: Rename constant conflicting with built-in type: Hash

What does this PR do?
Renames Datadog::Tracing::Contrib::Utils::Quantization::Hash to Datadog::Tracing::Contrib::Utils::Quantization::HashFormatter.

Motivation:
Datadog::Tracing::Contrib::Utils::Quantization::Hash collides with Ruby's standard Hash constant, when referenced through nested constant lookup.
This can cause you to reference Hash, normally wanting the std Hash class, but end up with Datadog::Tracing::Contrib::Utils::Quantization::Hash.

Change log entry
None. Internal.

@marcotc marcotc added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label May 22, 2026
@dd-octo-sts dd-octo-sts Bot added integrations Involves tracing integrations tracing labels May 22, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 22, 2026

Typing analysis

Note: Ignored files are excluded from the next sections.

steep:ignore comments

This PR introduces 1 steep:ignore comment, and clears 1 steep:ignore comment.

steep:ignore comments (+1-1)Introduced:
lib/datadog/tracing/contrib/utils/quantization/hash_formatter.rb:15
Cleared:
lib/datadog/tracing/contrib/utils/quantization/hash.rb:15

Untyped methods

This PR introduces 3 untyped methods and 5 partially typed methods, and clears 3 untyped methods and 5 partially typed methods.

Untyped methods (+3-3)Introduced:
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:25
└── def self?.merge_options: (untyped original, untyped additional) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:27
└── def self?.indifferent_equals: (untyped value) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:29
└── def self?.convert_value: (untyped value) -> untyped
Cleared:
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:25
└── def self?.merge_options: (untyped original, untyped additional) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:27
└── def self?.indifferent_equals: (untyped value) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:29
└── def self?.convert_value: (untyped value) -> untyped
Partially typed methods (+5-5)Introduced:
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:15
└── def self?.format: (untyped hash_obj, ?::Hash[untyped, untyped] options) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:17
└── def self?.format!: (untyped hash_obj, ?::Hash[untyped, untyped] options) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:19
└── def self?.format_hash: (untyped hash_obj, ?::Hash[untyped, untyped] options) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:21
└── def self?.format_value: (untyped value, ?::Hash[untyped, untyped] options) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:23
└── def self?.format_array: (untyped value, untyped options) -> (untyped | ::Array[untyped])
Cleared:
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:15
└── def self?.format: (untyped hash_obj, ?::Hash[untyped, untyped] options) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:17
└── def self?.format!: (untyped hash_obj, ?::Hash[untyped, untyped] options) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:19
└── def self?.format_hash: (untyped hash_obj, ?::Hash[untyped, untyped] options) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:21
└── def self?.format_value: (untyped value, ?::Hash[untyped, untyped] options) -> untyped
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:23
└── def self?.format_array: (untyped value, untyped options) -> (untyped | ::Array[untyped])

Untyped other declarations

This PR introduces 1 untyped other declaration and 2 partially typed other declarations, and clears 1 untyped other declaration and 2 partially typed other declarations.

Untyped other declarations (+1-1)Introduced:
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:13
└── DEFAULT_OPTIONS: { exclude: untyped, show: untyped, placeholder: untyped }
Cleared:
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:13
└── DEFAULT_OPTIONS: { exclude: untyped, show: untyped, placeholder: untyped }
Partially typed other declarations (+2-2)Introduced:
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:9
└── EXCLUDE_KEYS: ::Array[untyped]
sig/datadog/tracing/contrib/utils/quantization/hash_formatter.rbs:11
└── SHOW_KEYS: ::Array[untyped]
Cleared:
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:9
└── EXCLUDE_KEYS: ::Array[untyped]
sig/datadog/tracing/contrib/utils/quantization/hash.rbs:11
└── SHOW_KEYS: ::Array[untyped]

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept on the line before the definition to remove it from the stats.

@marcotc marcotc marked this pull request as ready for review May 22, 2026 03:30
@marcotc marcotc requested review from a team as code owners May 22, 2026 03:30
@marcotc marcotc requested review from vpellan and wantsui May 22, 2026 03:30
@datadog-prod-us1-6
Copy link
Copy Markdown

datadog-prod-us1-6 Bot commented May 22, 2026

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 97.09% (-0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 55eb893 | Docs | Datadog PR Page | Give us feedback!

@Strech Strech enabled auto-merge May 28, 2026 08:25
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented May 28, 2026

Benchmarks

Benchmark execution time: 2026-05-28 08:51:39

Comparing candidate commit 55eb893 in PR branch rename-quantization-hash-constant with baseline commit b1a5c02 in branch master.

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

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@Strech Strech merged commit 4f395e0 into master May 28, 2026
585 checks passed
@Strech Strech deleted the rename-quantization-hash-constant branch May 28, 2026 08:53
@dd-octo-sts dd-octo-sts Bot added this to the 2.35.0 milestone May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos integrations Involves tracing integrations tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants