Use Collection from collections.abc instead of typing.List.

communication
junos 2021-05-07 12:44:34 +02:00
parent d5056d9b2f
commit 81080f7504
5 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
from typing import List from collections.abc import Collection
import pandas as pd import pandas as pd
@ -9,7 +9,7 @@ call_types = {1: "incoming", 2: "outgoing", 3: "missed"}
sms_types = {1: "received", 2: "sent"} sms_types = {1: "received", 2: "sent"}
def get_call_data(usernames: List) -> pd.DataFrame: def get_call_data(usernames: Collection) -> pd.DataFrame:
""" """
Read the data from the calls table and return it in a dataframe. Read the data from the calls table and return it in a dataframe.
@ -33,7 +33,7 @@ def get_call_data(usernames: List) -> pd.DataFrame:
return df_calls return df_calls
def get_sms_data(usernames: List) -> pd.DataFrame: def get_sms_data(usernames: Collection) -> pd.DataFrame:
""" """
Read the data from the sms table and return it in a dataframe. Read the data from the sms table and return it in a dataframe.

View File

@ -1,4 +1,4 @@
from typing import List from collections.abc import Collection
import pandas as pd import pandas as pd
@ -8,7 +8,7 @@ from setup import db_engine, session
screen_status = {0: "off", 1: "on", 2: "locked", 3: "unlocked"} screen_status = {0: "off", 1: "on", 2: "locked", 3: "unlocked"}
def get_screen_data(usernames: List) -> pd.DataFrame: def get_screen_data(usernames: Collection) -> pd.DataFrame:
""" """
Read the data from the screen table and return it in a dataframe. Read the data from the screen table and return it in a dataframe.

View File

@ -3,8 +3,8 @@ import unittest
from participants.query_db import get_usernames from participants.query_db import get_usernames
class CallsFeatures(unittest.TestCase): class ParticipantsQuery(unittest.TestCase):
def test_get_usernames(self): def test_get_usernames(self):
usernames_from_db = get_usernames() usernames_from_db = get_usernames()
print(usernames_from_db) print(type(usernames_from_db))
self.assertIsNotNone(usernames_from_db) self.assertIsNotNone(usernames_from_db)