Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of #14033: Added Mypy type annotations to some files. #14469

Merged
merged 53 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d74038b
Fixes part of #9749: Migrate few instances of angular-html-bind (#14263)
srijanreddy98 Nov 27, 2021
354d901
Merge remote-tracking branch 'upstream/develop' into develop
sahiljoster32 Nov 28, 2021
7930e4f
Merge remote-tracking branch 'upstream/develop' into develop
sahiljoster32 Dec 4, 2021
2ff1fcb
Merge remote-tracking branch 'upstream/develop' into develop
sahiljoster32 Dec 8, 2021
7da71af
Merge remote-tracking branch 'upstream/develop' into develop
sahiljoster32 Dec 9, 2021
6afee7e
Merge remote-tracking branch 'upstream/develop' into develop
sahiljoster32 Dec 11, 2021
f6a3c12
Merge remote-tracking branch 'upstream/develop' into develop
sahiljoster32 Dec 12, 2021
5dc96d8
pending with tests
sahiljoster32 Dec 18, 2021
bffe408
pending with caching_services
sahiljoster32 Dec 19, 2021
f65c8ba
lint 1
sahiljoster32 Dec 19, 2021
39fbb95
lint 2
sahiljoster32 Dec 19, 2021
c34365a
lint 3
sahiljoster32 Dec 19, 2021
7fec54c
pending with test
sahiljoster32 Dec 20, 2021
1885375
lint
sahiljoster32 Dec 20, 2021
9667b75
done
sahiljoster32 Dec 21, 2021
13f1b09
fixed models type
sahiljoster32 Dec 21, 2021
8a67ca0
nits
sahiljoster32 Dec 21, 2021
c4c2a94
removed conflicts
sahiljoster32 Dec 21, 2021
44a0126
added changes
sahiljoster32 Dec 21, 2021
d11cfaf
lint 1
sahiljoster32 Dec 21, 2021
62b2e5e
lint again :_(
sahiljoster32 Dec 21, 2021
9b7a5b5
added changes -1
sahiljoster32 Dec 23, 2021
fe36b85
changes -2
sahiljoster32 Dec 23, 2021
fd656c8
changes -3
sahiljoster32 Dec 28, 2021
28669b1
changes -4
sahiljoster32 Jan 4, 2022
94084f6
added changes -3
sahiljoster32 Jan 4, 2022
601d151
fixing backend tests
sahiljoster32 Jan 4, 2022
44e8825
added changes -4
sahiljoster32 Jan 4, 2022
2e91bd8
changes -5
sahiljoster32 Jan 6, 2022
c647552
added changes
sahiljoster32 Jan 8, 2022
20c8315
Merge remote-tracking branch 'upstream/develop' into mytypes
sahiljoster32 Jan 8, 2022
176807f
added literals
sahiljoster32 Jan 8, 2022
5252178
added overload decorator
sahiljoster32 Jan 9, 2022
6b6ead6
Merge remote-tracking branch 'upstream/develop' into mytypes
sahiljoster32 Jan 12, 2022
6a3f29b
added changes
sahiljoster32 Jan 13, 2022
1d19b94
added changes
sahiljoster32 Jan 14, 2022
4d29919
removed conflicts
sahiljoster32 Jan 14, 2022
a85bc4f
added changes -12
sahiljoster32 Jan 14, 2022
3d99ce3
added changes
sahiljoster32 Jan 15, 2022
53a8d9a
removed merge conflicts
sahiljoster32 Jan 15, 2022
e4017ee
lint
sahiljoster32 Jan 15, 2022
9537ed6
fixed backend test
sahiljoster32 Jan 15, 2022
b943be9
added changes
sahiljoster32 Jan 16, 2022
2f62fd9
lint
sahiljoster32 Jan 16, 2022
c71a403
added changes
sahiljoster32 Jan 16, 2022
d0a9978
test coverage
sahiljoster32 Jan 16, 2022
4ca7c69
test coverage -2
sahiljoster32 Jan 16, 2022
2840a8a
added overload
sahiljoster32 Jan 17, 2022
69cac5d
Update core/domain/caching_services.py
sahiljoster32 Jan 17, 2022
995563c
added changes
sahiljoster32 Jan 18, 2022
c0b4738
Merge branch 'develop' of https://github.com/oppia/oppia into mytypes
sahiljoster32 Jan 18, 2022
b299913
Merge remote-tracking branch 'origin/mytypes' into mytypes
sahiljoster32 Jan 18, 2022
085e97e
corrected comment
sahiljoster32 Jan 18, 2022
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
Prev Previous commit
Next Next commit
lint 2
  • Loading branch information
sahiljoster32 committed Dec 19, 2021
commit 39fbb9505f8f6b159e6f343e54f9f5fca6e2b524
9 changes: 7 additions & 2 deletions core/domain/caching_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from __future__ import annotations

import json
from typing import Any, Dict, List

from core import python_utils
from core.domain import collection_domain
Expand All @@ -31,6 +30,8 @@
from core.domain import topic_domain
from core.platform import models

from typing import Any, Dict, List
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you typing this file? (I'm not against it, just that it wasn't assigned to you.

Copy link
Contributor Author

@sahiljoster32 sahiljoster32 Dec 23, 2021

Choose a reason for hiding this comment

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

because in file config_domain.py funciton set_multi and get_multi are called (here:

caching_services.set_multi(

and here
memcached_items = caching_services.get_multi(

)which are functions defined in caching_services.py.
so, just to aviod untyped-call error i added annotations to them.
also, this file is not assigned to anyone and most of it's functions are annotated while covering config_domian and it's test file.
so, that's why i added annotations here!!!


memory_cache_services = models.Registry.import_cache_services()

# NOTE: Namespaces and sub-namespaces cannot contain ':' because this is used as
Expand Down Expand Up @@ -230,7 +231,11 @@ def set_multi(
return memory_cache_services.set_multi(memory_cache_id_value_mapping)


def delete_multi(namespace: str, sub_namespace: str | None, obj_ids: List[str]) -> bool:
def delete_multi(
namespace: str,
sub_namespace: str | None,
obj_ids: List[str]
) -> bool:
"""Deletes multiple ids in the cache.

Args:
Expand Down
9 changes: 6 additions & 3 deletions core/domain/config_domain_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def test_config_property_change_object_with_invalid_cmd(self) -> None:
utils.ValidationError, 'Command invalid is not allowed'):
config_domain.ConfigPropertyChange({'cmd': 'invalid'})

def test_config_property_change_object_with_missing_attribute_in_cmd(self) -> None:
def test_config_property_change_object_with_missing_attribute_in_cmd(
self) -> None:
vojtechjelinek marked this conversation as resolved.
Show resolved Hide resolved
with self.assertRaisesRegexp(# type: ignore[no-untyped-call]
utils.ValidationError, (
'The following required attributes are missing: '
Expand All @@ -49,7 +50,8 @@ def test_config_property_change_object_with_missing_attribute_in_cmd(self) -> No
'cmd': 'change_property_value'
})

def test_config_property_change_object_with_extra_attribute_in_cmd(self) -> None:
def test_config_property_change_object_with_extra_attribute_in_cmd(
self) -> None:
with self.assertRaisesRegexp(# type: ignore[no-untyped-call]
utils.ValidationError, (
'The following extra attributes are present: invalid')):
Expand All @@ -59,7 +61,8 @@ def test_config_property_change_object_with_extra_attribute_in_cmd(self) -> None
'invalid': 'invalid'
})

def test_config_property_change_object_with_change_property_value(self) -> None:
def test_config_property_change_object_with_change_property_value(
self) -> None:
config_property_change_object = config_domain.ConfigPropertyChange({
'cmd': 'change_property_value',
'new_value': 'new_value'
Expand Down