Skip to content

Commit

Permalink
Fix type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
kaapstorm committed Nov 19, 2024
1 parent 86c82b0 commit c00be95
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
12 changes: 10 additions & 2 deletions corehq/apps/app_manager/xform_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
"""
from __future__ import annotations

import re
import uuid
from typing import Optional

from lxml import etree
from lxml.builder import E
Expand Down Expand Up @@ -424,13 +427,18 @@ def get_input_question_node(name_, groups_=None, choices_=None, **params_):

class Question(object):

def __init__(self, name, xform, groups=None):
def __init__(
self,
name: str,
xform: XFormBuilder,
groups: Optional[list[str]] = None,
) -> None:
self.name = name
self.xform = xform
self.groups = groups

@property
def form(self) -> "XFormBuilder":
def form(self) -> XFormBuilder:
return self.xform


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def setUpClass(cls):

def tearDown(self) -> None:
manager.cluster_routing(enabled=True)
return super().tearDown()
super().tearDown()

def test_invalid_index_canonical_raises(self):
with self.assertRaises(CommandError):
Expand Down
2 changes: 2 additions & 0 deletions corehq/apps/userreports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ def is_this_data_source(rebuild_task):
return args[0] == data_source_config_id

def iter_tasks():
if not flower_url:
return
task_names = (
'corehq.apps.userreports.tasks.rebuild_indicators',
'corehq.apps.userreports.tasks.rebuild_indicators_in_place',
Expand Down
2 changes: 1 addition & 1 deletion corehq/apps/userreports/tests/test_data_source_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def setUpClass(cls) -> None:
"type": "property_name"
}
cls.config = DataSourceConfiguration.wrap(cls.config)
return super().setUpClass()
super().setUpClass()

def test_raises_when_domain_has_no_permission(self):
self.config.domain = 'domain_nopermission'
Expand Down
5 changes: 4 additions & 1 deletion corehq/messaging/smsbackends/twilio/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def send(self, msg, orig_phone_number=None, *args, **kwargs):
msg.backend_message_id = message.sid
msg.save()

def from_or_messaging_service_sid(self, phone_number: str) -> (Optional[str], Optional[str]):
def from_or_messaging_service_sid(
self,
phone_number: str,
) -> tuple[Optional[str], Optional[str]]:
if self.phone_number_is_messaging_service_sid(phone_number):
return None, phone_number
else:
Expand Down

0 comments on commit c00be95

Please sign in to comment.