diff --git a/task-1/output/clean_users.json b/task-1/output/clean_users.json new file mode 100644 index 0000000..38a6b87 --- /dev/null +++ b/task-1/output/clean_users.json @@ -0,0 +1,86 @@ +[ + { + "id": 1, + "name": "Alice Johnson", + "email": "alice.johnson@company.com", + "department": "Engineering", + "salary": 85000 + }, + { + "id": 2, + "name": "Bob Smith", + "email": "bob.smith@company.com", + "department": "Unknown", + "salary": 72000 + }, + { + "id": 3, + "name": "Carol Williams", + "email": "carol.williams@company.com", + "department": "Engineering", + "salary": null + }, + { + "id": 4, + "name": "David, Jr.", + "email": "david.brown@company.com", + "department": "Sales", + "salary": 68000 + }, + { + "id": 5, + "name": "Caf\u00e9 Owner", + "email": "eva@company.com", + "department": "Engineering", + "salary": 88000 + }, + { + "id": 6, + "name": "FRANK WILSON", + "email": "frank@company.com", + "department": "marketing", + "salary": 95000 + }, + { + "id": 7, + "name": "Grace Lee", + "email": "grace.lee@company.com", + "department": "Engineering", + "salary": null + }, + { + "id": 9, + "name": "Henry Davis", + "email": "henry.davis@company.com", + "department": "Sales", + "salary": 82000 + }, + { + "id": 11, + "name": "Linda Taylor", + "email": "linda.t@company.com", + "department": "HR", + "salary": 55000 + }, + { + "id": 12, + "name": "Mike Brown", + "email": "mike.b@company.com", + "department": "Sales", + "salary": null + }, + { + "id": 13, + "name": "Sarah Connor", + "email": "s.connor@sky.net", + "department": "Unknown", + "salary": -1 + }, + { + "id": 15, + "name": "John Doe", + "email": "john.doe@company.net", + "department": "Engineering", + "salary": 100000 + } +] \ No newline at end of file diff --git a/task-1/src/utils.py b/task-1/src/utils.py index 2762398..a3312cd 100644 --- a/task-1/src/utils.py +++ b/task-1/src/utils.py @@ -13,7 +13,7 @@ def clean_name(raw: str) -> str: Returns the cleaned string. An empty input returns "". """ - raise NotImplementedError("Implement clean_name (Task 1)") + return raw.strip() def clean_email(raw: str) -> str: @@ -21,7 +21,7 @@ def clean_email(raw: str) -> str: Returns the cleaned string. An empty input returns "". """ - raise NotImplementedError("Implement clean_email (Task 1)") + return raw.strip().lower() def clean_department(raw: str) -> str: @@ -29,8 +29,12 @@ def clean_department(raw: str) -> str: Strip whitespace; treat empty string as missing. """ - raise NotImplementedError("Implement clean_department (Task 1)") - + normilized = raw.strip() + + if not normilized: + return "Unknown" + + return normilized def clean_salary(raw: str) -> int | None: """Parse a messy salary cell into an int. @@ -38,4 +42,15 @@ def clean_salary(raw: str) -> int | None: Handles inputs like "85000", " 95000", '"68,000"', "N/A", "". Returns None when the value cannot be parsed (missing or "N/A"). """ - raise NotImplementedError("Implement clean_salary (Task 1)") + normilized = raw.strip() + + if not normilized or normilized == "N/A": + return None + + normilized = normilized.replace('"', "") + normilized = normilized.replace(",", "") + + try: + return int(normilized) + except ValueError: + return None \ No newline at end of file diff --git a/task-3/azure_proof.jpg b/task-3/azure_proof.jpg new file mode 100644 index 0000000..57b9ffd Binary files /dev/null and b/task-3/azure_proof.jpg differ