Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions sentry_sdk/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,6 @@ class GraphQLCollectionBehaviour(TypedDict):
document: bool
variables: bool

class DatabaseCollectionUserOptions(TypedDict, total=False):
query_params: bool

class DatabaseCollectionBehaviour(TypedDict):
query_params: bool

class HttpHeadersCollectionUserOptions(TypedDict, total=False):
request: "KeyValueCollectionBehaviour"

Expand All @@ -192,7 +186,7 @@ class DataCollectionUserOptions(TypedDict, total=False):
query_params: "KeyValueCollectionBehaviour"
graphql: "GraphQLCollectionUserOptions"
gen_ai: "GenAICollectionUserOptions"
database: "DatabaseCollectionUserOptions"
database_query_data: bool
queues: bool
stack_frame_variables: bool
frame_context_lines: int
Expand All @@ -206,7 +200,7 @@ class DataCollection(TypedDict):
query_params: "KeyValueCollectionBehaviour"
graphql: "GraphQLCollectionBehaviour"
gen_ai: "GenAICollectionBehaviour"
database: "DatabaseCollectionBehaviour"
database_query_data: bool
queues: bool
stack_frame_variables: bool
frame_context_lines: int
Expand Down
11 changes: 2 additions & 9 deletions sentry_sdk/data_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from typing import Any, Dict, Literal

from sentry_sdk._types import (
DatabaseCollectionBehaviour,
DataCollection,
GenAICollectionBehaviour,
GraphQLCollectionBehaviour,
Expand Down Expand Up @@ -107,7 +106,7 @@ def _map_from_send_default_pii(
"query_params": {"mode": kv_mode, "terms": terms},
"graphql": {"document": send_default_pii, "variables": send_default_pii},
"gen_ai": {"inputs": send_default_pii, "outputs": send_default_pii},
"database": {"query_params": send_default_pii},
"database_query_data": send_default_pii,
"queues": send_default_pii,
"stack_frame_variables": include_local_variables,
"frame_context_lines": (
Expand Down Expand Up @@ -157,7 +156,7 @@ def _resolve_explicit(
"query_params": _kvcb_from_value(d.get("query_params") or {}),
"graphql": _graphql_from_value(d.get("graphql") or {}),
"gen_ai": _gen_ai_from_value(d.get("gen_ai") or {}),
"database": _database_from_value(d.get("database") or {}),
"database_query_data": d.get("database_query_data", True),
"queues": d.get("queues", True),
"stack_frame_variables": stack_frame_variables,
"frame_context_lines": frame_context_lines,
Expand Down Expand Up @@ -211,12 +210,6 @@ def _graphql_from_value(
}


def _database_from_value(
val: "dict[str, Any]",
) -> "DatabaseCollectionBehaviour":
return {"query_params": val.get("query_params", True)}


def _resolve_data_collection(options: "Dict[str, Any]") -> "DataCollection":
"""
Resolve the effective ``DataCollection`` dict from client ``options``.
Expand Down
8 changes: 3 additions & 5 deletions tests/test_data_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ def _get(dc, path):
"query_params": None,
"graphql": None,
"gen_ai": None,
"database": None,
}
},
{
Expand All @@ -177,7 +176,6 @@ def _get(dc, path):
"graphql.variables": True,
"gen_ai.inputs": True,
"gen_ai.outputs": True,
"database.query_params": True,
},
id="none_values_fall_back_to_spec_defaults",
),
Expand All @@ -186,7 +184,7 @@ def _get(dc, path):
{
"graphql.document": True,
"graphql.variables": True,
"database.query_params": True,
"database_query_data": True,
},
id="explicit_graphql_database_defaults",
),
Expand All @@ -195,7 +193,7 @@ def _get(dc, path):
{
"graphql.document": False,
"graphql.variables": False,
"database.query_params": False,
"database_query_data": False,
"queues": False,
},
id="legacy_pii_off_gates_graphql_database_and_queues",
Expand All @@ -205,7 +203,7 @@ def _get(dc, path):
{
"graphql.document": True,
"graphql.variables": True,
"database.query_params": True,
"database_query_data": True,
"queues": True,
},
id="legacy_pii_on_collects_graphql_database_and_queues",
Expand Down
Loading