Skip to content

feat(huggingface_hub): Gate prompt/response collection on data_collection option - #7172

Open
ericapisani wants to merge 5 commits into
masterfrom
py-2588-hugging-face
Open

feat(huggingface_hub): Gate prompt/response collection on data_collection option#7172
ericapisani wants to merge 5 commits into
masterfrom
py-2588-hugging-face

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Prompts, response text, tool calls, and available tools are now gated on the data_collection.gen_ai.inputs/outputs experiment when configured, falling back to the existing send_default_pii/include_prompts check otherwise.

Refs PY-2588
Refs #6748

…tion option

Prompts, response text, tool calls, and available tools are now gated on
the `data_collection.gen_ai.inputs`/`outputs` experiment when configured,
falling back to the existing `send_default_pii`/`include_prompts` check
otherwise.

Refs PY-2588
Refs #6748
@ericapisani
ericapisani requested a review from a team as a code owner August 11, 2026 17:10
@linear-code

linear-code Bot commented Aug 11, 2026

Copy link
Copy Markdown

PY-2588

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2ec0d48. Configure here.

Comment thread sentry_sdk/integrations/huggingface_hub.py
Drop the shared DATA_COLLECTION_PARAMS/DATA_COLLECTION_PARAM_NAMES constants and write the parameter names and cases directly in each test's parametrize decorator.
Comment thread sentry_sdk/integrations/huggingface_hub.py
Drop _expected_keys and _get_gen_ai_span_data. Each parametrized case now lists the expected present and absent span attributes explicitly, and the streaming/non-streaming span lookup lives in each test body.
The DATA_COLLECTION_* constants were interleaved with the tests that used them. Move them into a single block ahead of the data collection tests.
The four DATA_COLLECTION_*_EXPECTED_VALUES dicts were each used by one test. Move them into the test bodies as expected_values; DATA_COLLECTION_TOOLS stays module-level since two tests share it.
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

104962 passed | ⏭️ 6677 skipped | Total: 111639 | Pass Rate: 94.02% | Execution Time: 361m 25s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +560
Passed Tests 📈 +560
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2478 uncovered lines.
✅ Project coverage is 90.17%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/huggingface_hub.py 100.00% ⚠️ 4 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.14%    90.17%    +0.03%
==========================================
  Files          193       193         —
  Lines        25183     25211       +28
  Branches      9176      9210       +34
==========================================
+ Hits         22700     22733       +33
- Misses        2483      2478        -5
- Partials      1429      1431        +2

Generated by Codecov Action

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.

1 participant