Просмотр исходного кода

ref: auto fix unneeded type ignores (#50557)

hello large portion of the company -- the important changes are in
pyproject.toml and the file which generated this at the end of the patch
anthony sottile 1 год назад
Родитель
Сommit
188c396800

+ 0 - 59
pyproject.toml

@@ -164,10 +164,8 @@ module = [
     "bitfield.admin",
     "bitfield.models",
     "bitfield.types",
-    "django_picklefield.fields",
     "sentry._importchecker",
     "sentry.admin",
-    "sentry.analytics.pubsub",
     "sentry.api.authentication",
     "sentry.api.base",
     "sentry.api.bases.avatar",
@@ -217,8 +215,6 @@ module = [
     "sentry.api.endpoints.codeowners",
     "sentry.api.endpoints.codeowners.details",
     "sentry.api.endpoints.codeowners.external_actor.team_details",
-    "sentry.api.endpoints.codeowners.external_actor.team_index",
-    "sentry.api.endpoints.codeowners.external_actor.user_index",
     "sentry.api.endpoints.codeowners.index",
     "sentry.api.endpoints.data_scrubbing_selector_suggestions",
     "sentry.api.endpoints.debug_files",
@@ -323,7 +319,6 @@ module = [
     "sentry.api.endpoints.organization_integration_repos",
     "sentry.api.endpoints.organization_issues_count",
     "sentry.api.endpoints.organization_issues_resolved_in_release",
-    "sentry.api.endpoints.organization_measurements_meta",
     "sentry.api.endpoints.organization_member",
     "sentry.api.endpoints.organization_member.details",
     "sentry.api.endpoints.organization_member.index",
@@ -337,7 +332,6 @@ module = [
     "sentry.api.endpoints.organization_onboarding_continuation_email",
     "sentry.api.endpoints.organization_onboarding_tasks",
     "sentry.api.endpoints.organization_pinned_searches",
-    "sentry.api.endpoints.organization_profiling_profiles",
     "sentry.api.endpoints.organization_projects",
     "sentry.api.endpoints.organization_projects_experiment",
     "sentry.api.endpoints.organization_projects_sent_first_event",
@@ -433,16 +427,11 @@ module = [
     "sentry.api.endpoints.source_map_debug",
     "sentry.api.endpoints.system_health",
     "sentry.api.endpoints.system_options",
-    "sentry.api.endpoints.team_alerts_triggered",
-    "sentry.api.endpoints.team_all_unresolved_issues",
     "sentry.api.endpoints.team_details",
-    "sentry.api.endpoints.team_groups_old",
-    "sentry.api.endpoints.team_issue_breakdown",
     "sentry.api.endpoints.team_projects",
     "sentry.api.endpoints.team_release_count",
     "sentry.api.endpoints.team_stats",
     "sentry.api.endpoints.team_time_to_resolution",
-    "sentry.api.endpoints.team_unresolved_issue_age",
     "sentry.api.endpoints.user_authenticator_details",
     "sentry.api.endpoints.user_authenticator_enroll",
     "sentry.api.endpoints.user_details",
@@ -466,16 +455,12 @@ module = [
     "sentry.api.exceptions",
     "sentry.api.fields.actor",
     "sentry.api.fields.avatar",
-    "sentry.api.fields.secret",
     "sentry.api.fields.user",
     "sentry.api.helpers.deprecation",
     "sentry.api.helpers.events",
     "sentry.api.helpers.group_index.delete",
     "sentry.api.helpers.group_index.index",
     "sentry.api.helpers.group_index.update",
-    "sentry.api.helpers.group_index.validators.group",
-    "sentry.api.helpers.group_index.validators.in_commit",
-    "sentry.api.helpers.group_index.validators.inbox_details",
     "sentry.api.helpers.group_index.validators.status_details",
     "sentry.api.helpers.mobile",
     "sentry.api.invite_helper",
@@ -543,8 +528,6 @@ module = [
     "sentry.api.validators.project_codeowners",
     "sentry.api.validators.servicehook",
     "sentry.api_gateway.proxy",
-    "sentry.apidocs.extensions",
-    "sentry.apidocs.parameters",
     "sentry.apidocs.schema",
     "sentry.app",
     "sentry.audit_log.manager",
@@ -589,17 +572,11 @@ module = [
     "sentry.db.deletion",
     "sentry.db.mixin",
     "sentry.db.models.base",
-    "sentry.db.models.fields.bounded",
-    "sentry.db.models.fields.foreignkey",
     "sentry.db.models.fields.gzippeddict",
-    "sentry.db.models.fields.hybrid_cloud_foreign_key",
     "sentry.db.models.fields.jsonfield",
     "sentry.db.models.fields.node",
-    "sentry.db.models.fields.onetoone",
     "sentry.db.models.fields.picklefield",
-    "sentry.db.models.fields.text",
     "sentry.db.models.manager.base",
-    "sentry.db.models.manager.base_query_set",
     "sentry.db.models.paranoia",
     "sentry.db.models.query",
     "sentry.db.models.utils",
@@ -622,7 +599,6 @@ module = [
     "sentry.discover.endpoints.serializers",
     "sentry.discover.models",
     "sentry.discover.tasks",
-    "sentry.dynamic_sampling.models.projects_rebalancing",
     "sentry.dynamic_sampling.prioritise_projects",
     "sentry.dynamic_sampling.prioritise_transactions",
     "sentry.dynamic_sampling.recalibrate_transactions",
@@ -686,15 +662,12 @@ module = [
     "sentry.incidents.logic",
     "sentry.incidents.models",
     "sentry.incidents.subscription_processor",
-    "sentry.incidents.tasks",
     "sentry.ingest.consumer_v2.factory",
     "sentry.ingest.inbound_filters",
     "sentry.ingest.ingest_consumer",
     "sentry.ingest.transaction_clusterer.datasource.redis",
     "sentry.ingest.transaction_clusterer.datasource.snuba",
     "sentry.ingest.transaction_clusterer.rules",
-    "sentry.ingest.transaction_clusterer.tasks",
-    "sentry.ingest.transaction_clusterer.tree",
     "sentry.ingest.userreport",
     "sentry.integrations.aws_lambda.integration",
     "sentry.integrations.base",
@@ -827,7 +800,6 @@ module = [
     "sentry.interfaces.spans",
     "sentry.interfaces.stacktrace",
     "sentry.interfaces.user",
-    "sentry.issues.apps",
     "sentry.issues.constants",
     "sentry.issues.escalating",
     "sentry.issues.escalating_group_forecast",
@@ -1092,13 +1064,11 @@ module = [
     "sentry.notifications.utils",
     "sentry.notifications.utils.avatar",
     "sentry.notifications.utils.participants",
-    "sentry.notifications.utils.tasks",
     "sentry.onboarding_tasks.backends.organization_onboarding_task",
     "sentry.onboarding_tasks.base",
     "sentry.options.defaults",
     "sentry.ownership.grammar",
     "sentry.pipeline.base",
-    "sentry.pipeline.store",
     "sentry.pipeline.types",
     "sentry.pipeline.views.base",
     "sentry.pipeline.views.nested",
@@ -1125,7 +1095,6 @@ module = [
     "sentry.plugins.sentry_webhooks.plugin",
     "sentry.plugins.utils",
     "sentry.plugins.validators.url",
-    "sentry.processing.backpressure.redis",
     "sentry.profiles.flamegraph",
     "sentry.profiles.task",
     "sentry.profiles.utils",
@@ -1213,7 +1182,6 @@ module = [
     "sentry.search.events.builder.metrics",
     "sentry.search.events.builder.spans_metrics",
     "sentry.search.events.constants",
-    "sentry.search.events.datasets.base",
     "sentry.search.events.datasets.discover",
     "sentry.search.events.datasets.filter_aliases",
     "sentry.search.events.datasets.function_aliases",
@@ -1233,20 +1201,14 @@ module = [
     "sentry.sentry_apps.components",
     "sentry.sentry_apps.installations",
     "sentry.sentry_metrics.consumers.indexer.slicing_router",
-    "sentry.sentry_metrics.consumers.last_seen_updater",
-    "sentry.sentry_metrics.indexer.postgres.apps",
     "sentry.sentry_metrics.indexer.postgres.models",
     "sentry.sentry_metrics.indexer.postgres.postgres_v2",
-    "sentry.services.hybrid_cloud",
     "sentry.services.hybrid_cloud.actor",
     "sentry.services.hybrid_cloud.app.impl",
     "sentry.services.hybrid_cloud.app.serial",
     "sentry.services.hybrid_cloud.auth.impl",
-    "sentry.services.hybrid_cloud.auth.model",
-    "sentry.services.hybrid_cloud.filter_query",
     "sentry.services.hybrid_cloud.identity.serial",
     "sentry.services.hybrid_cloud.integration.impl",
-    "sentry.services.hybrid_cloud.integration.model",
     "sentry.services.hybrid_cloud.integration.serial",
     "sentry.services.hybrid_cloud.integration.service",
     "sentry.services.hybrid_cloud.log.impl",
@@ -1260,7 +1222,6 @@ module = [
     "sentry.services.hybrid_cloud.organizationmember_mapping.impl",
     "sentry.services.hybrid_cloud.organizationmember_mapping.service",
     "sentry.services.hybrid_cloud.project_key.model",
-    "sentry.services.hybrid_cloud.rpc",
     "sentry.services.hybrid_cloud.user.impl",
     "sentry.services.hybrid_cloud.user.serial",
     "sentry.services.hybrid_cloud.user_option.impl",
@@ -1268,10 +1229,6 @@ module = [
     "sentry.shared_integrations.client.base",
     "sentry.shared_integrations.client.internal",
     "sentry.shared_integrations.client.proxy",
-    "sentry.shared_integrations.response.base",
-    "sentry.shared_integrations.response.mapping",
-    "sentry.shared_integrations.response.sequence",
-    "sentry.shared_integrations.track_response",
     "sentry.signals",
     "sentry.silo.client",
     "sentry.similarity.backends.dummy",
@@ -1312,7 +1269,6 @@ module = [
     "sentry.tasks.assemble",
     "sentry.tasks.auth",
     "sentry.tasks.auto_archive_issues",
-    "sentry.tasks.auto_enable_codecov",
     "sentry.tasks.auto_ongoing_issues",
     "sentry.tasks.auto_resolve_issues",
     "sentry.tasks.base",
@@ -1346,9 +1302,7 @@ module = [
     "sentry.tasks.integrations.update_comment",
     "sentry.tasks.integrations.vsts.kickoff_subscription_check",
     "sentry.tasks.integrations.vsts.subscription_check",
-    "sentry.tasks.low_priority_symbolication",
     "sentry.tasks.merge",
-    "sentry.tasks.organization_mapping",
     "sentry.tasks.post_process",
     "sentry.tasks.process_buffer",
     "sentry.tasks.relay",
@@ -1396,7 +1350,6 @@ module = [
     "sentry.types.organization",
     "sentry.unmerge",
     "sentry.utils.appleconnect.appstore_connect",
-    "sentry.utils.assets",
     "sentry.utils.audit",
     "sentry.utils.auth",
     "sentry.utils.avatar",
@@ -1409,12 +1362,9 @@ module = [
     "sentry.utils.debug",
     "sentry.utils.distutils.commands.base",
     "sentry.utils.distutils.commands.build_assets",
-    "sentry.utils.email.backend",
     "sentry.utils.email.list_resolver",
     "sentry.utils.email.signer",
     "sentry.utils.geo",
-    "sentry.utils.integrationdocs",
-    "sentry.utils.jwt",
     "sentry.utils.locking.backends.migration",
     "sentry.utils.metrics",
     "sentry.utils.performance_issues.base",
@@ -1448,7 +1398,6 @@ module = [
     "sentry.utils.snowflake",
     "sentry.utils.snuba",
     "sentry.utils.strings",
-    "sentry.utils.suspect_resolutions.apps",
     "sentry.utils.suspect_resolutions.get_suspect_resolutions",
     "sentry.utils.suspect_resolutions.metric_correlation",
     "sentry.utils.suspect_resolutions_releases.get_suspect_resolutions_releases",
@@ -1515,7 +1464,6 @@ module = [
     "sentry.web.frontend.shared_group_details",
     "sentry.web.frontend.twofactor",
     "sentry.web.frontend.unsubscribe_notifications",
-    "sentry.web.helpers",
     "sentry.web.urls",
     "sentry.wsgi",
     "sentry_plugins.amazon_sqs.plugin",
@@ -1705,7 +1653,6 @@ module = [
     "tests.sentry.api.endpoints.test_organization_sentry_apps",
     "tests.sentry.api.endpoints.test_organization_sentry_functions",
     "tests.sentry.api.endpoints.test_organization_teams",
-    "tests.sentry.api.endpoints.test_project_app_store_connect_credentials",
     "tests.sentry.api.endpoints.test_project_artifact_bundle_file_details",
     "tests.sentry.api.endpoints.test_project_artifact_lookup",
     "tests.sentry.api.endpoints.test_project_avatar",
@@ -2058,12 +2005,10 @@ module = [
     "tests.sentry.issues.test_grouptype",
     "tests.sentry.issues.test_ignored",
     "tests.sentry.issues.test_ingest",
-    "tests.sentry.issues.test_issue_occurrence",
     "tests.sentry.issues.test_merge",
     "tests.sentry.issues.test_occurrence_consumer",
     "tests.sentry.issues.test_ongoing",
     "tests.sentry.issues.test_producer",
-    "tests.sentry.issues.test_search_issues_dataset",
     "tests.sentry.issues.test_status_change",
     "tests.sentry.issues.test_update_inbox",
     "tests.sentry.issues.test_utils",
@@ -2210,11 +2155,9 @@ module = [
     "tests.sentry.plugins.sentry_webhooks.test_plugin",
     "tests.sentry.plugins.test_config",
     "tests.sentry.plugins.test_repository_provider",
-    "tests.sentry.post_process_forwarder.test_post_process_forwarder",
     "tests.sentry.processing.realtime_metrics.test_redis",
     "tests.sentry.profiles.consumers.test_process",
     "tests.sentry.profiles.test_task",
-    "tests.sentry.profiling.test_utils",
     "tests.sentry.quotas.test_base",
     "tests.sentry.quotas.test_redis",
     "tests.sentry.ratelimits.test_cardinality",
@@ -2351,7 +2294,6 @@ module = [
     "tests.sentry.tasks.test_store",
     "tests.sentry.tasks.test_update_code_owners_schema",
     "tests.sentry.tasks.test_update_user_reports",
-    "tests.sentry.tasks.test_weekly_escalating_forecast",
     "tests.sentry.tasks.test_weekly_reports",
     "tests.sentry.templatetags.test_sentry_api",
     "tests.sentry.templatetags.test_sentry_assets",
@@ -2397,7 +2339,6 @@ module = [
     "tests.sentry.utils.test_event_frames",
     "tests.sentry.utils.test_functional",
     "tests.sentry.utils.test_http",
-    "tests.sentry.utils.test_jwt",
     "tests.sentry.utils.test_letter_avatar",
     "tests.sentry.utils.test_linksign",
     "tests.sentry.utils.test_meta",

+ 1 - 1
src/django_picklefield/fields.py

@@ -82,7 +82,7 @@ def dbsafe_encode(
     return PickledObject(value)
 
 
-class PickledObjectField(models.Field):  # type: ignore
+class PickledObjectField(models.Field):
     """
     A field that will accept *any* python object and store it in the
     database. PickledObjectField will optionally compress its values if

+ 1 - 1
src/sentry/analytics/pubsub.py

@@ -5,7 +5,7 @@ __all__ = ("PubSubAnalytics",)
 import logging
 
 from google.auth.exceptions import GoogleAuthError
-from google.cloud import pubsub_v1  # type: ignore[attr-defined]
+from google.cloud import pubsub_v1
 
 from sentry.utils.json import dumps
 

+ 1 - 1
src/sentry/api/bases/external_actor.py

@@ -36,7 +36,7 @@ STRICT_NAME_PROVIDERS = {
 }
 
 
-class ExternalActorSerializerBase(CamelSnakeModelSerializer):  # type: ignore
+class ExternalActorSerializerBase(CamelSnakeModelSerializer):
     external_id = serializers.CharField(required=False, allow_null=True)
     external_name = serializers.CharField(required=True)
     provider = serializers.ChoiceField(choices=get_provider_choices(AVAILABLE_PROVIDERS))

+ 1 - 1
src/sentry/api/bases/organization.py

@@ -173,7 +173,7 @@ class OrganizationAlertRulePermission(OrganizationPermission):
     }
 
 
-class OrganizationEndpoint(Endpoint):  # type: ignore[misc]
+class OrganizationEndpoint(Endpoint):
     permission_classes = (OrganizationPermission,)
 
     def get_projects(

+ 1 - 1
src/sentry/api/bases/rule.py

@@ -7,7 +7,7 @@ from sentry.api.exceptions import ResourceDoesNotExist
 from sentry.models import Rule, RuleStatus
 
 
-class RuleEndpoint(ProjectEndpoint):  # type: ignore
+class RuleEndpoint(ProjectEndpoint):
     permission_classes = (ProjectAlertRulePermission,)
 
     def convert_args(

+ 1 - 1
src/sentry/api/endpoints/codeowners/__init__.py

@@ -17,7 +17,7 @@ from sentry.utils.codeowners import MAX_RAW_LENGTH
 from .analytics import *  # NOQA
 
 
-class ProjectCodeOwnerSerializer(CamelSnakeModelSerializer):  # type: ignore
+class ProjectCodeOwnerSerializer(CamelSnakeModelSerializer):
     code_mapping_id = serializers.IntegerField(required=True)
     raw = serializers.CharField(required=True)
     organization_integration_id = serializers.IntegerField(required=False)

+ 1 - 1
src/sentry/api/endpoints/codeowners/details.py

@@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
 
 
 @region_silo_endpoint
-class ProjectCodeOwnersDetailsEndpoint(ProjectEndpoint, ProjectCodeOwnersMixin):  # type: ignore
+class ProjectCodeOwnersDetailsEndpoint(ProjectEndpoint, ProjectCodeOwnersMixin):
     def convert_args(
         self,
         request: Request,

+ 1 - 1
src/sentry/api/endpoints/codeowners/external_actor/team_details.py

@@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
 
 
 @region_silo_endpoint
-class ExternalTeamDetailsEndpoint(TeamEndpoint, ExternalActorEndpointMixin):  # type: ignore
+class ExternalTeamDetailsEndpoint(TeamEndpoint, ExternalActorEndpointMixin):
     def convert_args(
         self,
         request: Request,

+ 1 - 1
src/sentry/api/endpoints/codeowners/external_actor/team_index.py

@@ -14,7 +14,7 @@ logger = logging.getLogger(__name__)
 
 
 @region_silo_endpoint
-class ExternalTeamEndpoint(TeamEndpoint, ExternalActorEndpointMixin):  # type: ignore
+class ExternalTeamEndpoint(TeamEndpoint, ExternalActorEndpointMixin):
     def post(self, request: Request, team: Team) -> Response:
         """
         Create an External Team

Некоторые файлы не были показаны из-за большого количества измененных файлов