Skip to content

ref(asgi): Drop send_default_pii support in _get_request_data - #7768

Open
ericapisani wants to merge 2 commits into
major/3.0from
py-2798-update-asgi-get-request-data
Open

ericapisani wants to merge 2 commits into
major/3.0from
py-2798-update-asgi-get-request-data

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Always filter the query string through the data_collection
url_query_params setting. The legacy send_default_pii path is
resolved into an equivalent data_collection default, so the raw
query string is no longer passed through.

Update the Django ASGI and FastAPI tests to configure
data_collection instead of send_default_pii.

Refs PY-2798
Refs #7566

Always filter the query string through the `data_collection`
`url_query_params` setting. The legacy `send_default_pii` path is
resolved into an equivalent `data_collection` default, so the raw
query string is no longer passed through.

Update the Django ASGI and FastAPI tests to configure
`data_collection` instead of `send_default_pii`.

Refs PY-2798
Refs #7566
…uest_data`

Read `REMOTE_ADDR` from `data_collection["user_info"]` only. The client
already resolves `send_default_pii` into `data_collection` at init, so
the legacy `should_send_default_pii()` fallback is redundant.

Update the ASGI and Django ASGI tests to configure `data_collection`
instead of `send_default_pii`, and remove the legacy `send_default_pii`
parametrized cases.
@linear-code

linear-code Bot commented Sep 29, 2026

Copy link
Copy Markdown

PY-2798

@ericapisani
ericapisani marked this pull request as ready for review September 29, 2026 17:14
@ericapisani
ericapisani requested a review from a team as a code owner September 29, 2026 17:14
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 57310 passed | ❌ 1 failed | ⏭️ 2709 skipped | Total: 60020 | Pass Rate: 95.48% | Execution Time: 161m 4s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -76839
Passed Tests 📉 -72380
Failed Tests 📈 +1
Skipped Tests 📉 -4460

➕ New Tests (1)

View new tests
  • test_input_attributes_nonstreaming_chat[messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
    • Status: ❌ Failing

❌ Failed Tests

test_input_attributes_nonstreaming_chat[messages0-expected_system_instructions0-expected_input_messages0]

File: tests.integrations.mistral.test_mistral
Suite: py3.10-mistral-v2.6.0
Error: KeyError: 139773220712896

Stack Trace
tests/integrations/mistral/test_mistral.py:389: in test_input_attributes_nonstreaming_chat
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:278: in __init__
    self._init_impl()
sentry_sdk/client.py:428: in _init_impl
    self.integrations = setup_integrations(
sentry_sdk/integrations/__init__.py:217: in setup_integrations
    for integration_cls in iter_default_integrations(
sentry_sdk/integrations/__init__.py:44: in iter_default_integrations
    yield getattr(import_module(module), cls)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1024: in _find_and_load
    ???
<frozen importlib._bootstrap>:171: in __enter__
    ???
<frozen importlib._bootstrap>:123: in acquire
    ???
E   KeyError: 139773220712896

✅ Patch coverage is 100.00%. Project has 2072 uncovered lines.
❌ Project coverage is 90.04%. Comparing base (b8d3978) to head (dbbc12b).

Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.25%    90.04%    -0.21%
==========================================
  Files          195       179       -16
  Lines        26195     20794     -5401
  Branches      9758      7308     -2450
==========================================
+ Hits         23641     18722     -4919
- Misses        2554      2072      -482
- Partials      1484      1221      -263

Generated by Codecov Action

@ericapisani
ericapisani changed the base branch from major/3.0 to master September 29, 2026 17:25
@ericapisani
ericapisani added this pull request to stack #7770 September 29, 2026 17:25
@ericapisani
ericapisani removed this pull request from stack #7770 September 29, 2026 17:26
@ericapisani
ericapisani changed the base branch from master to major/3.0 September 29, 2026 17:26
@ericapisani
ericapisani added this pull request to stack #7771 September 29, 2026 17:26

This branch has not been deployed

No deployments
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