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

Improvement: Refactor code to use dict.get() method #146

Open
4 tasks
codesankalp opened this issue Mar 26, 2021 · 4 comments
Open
4 tasks

Improvement: Refactor code to use dict.get() method #146

codesankalp opened this issue Mar 26, 2021 · 4 comments
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Status: Available Issue was approved and available to claim or abandoned for over 3 days. Type: Enhancement New feature or request.

Comments

@codesankalp
Copy link
Member

Description

As a developer,
I need code to be consistent and error-free.

Mocks

name = data["name"]
profile_image = data["profile_image"]

For example this can be replaced by the get method i.e. data.get("KEY", "DEFAULT_VALUE") to avoid KeyError

Acceptance Criteria

Update [Required]

  • Use get method in all code to avoid the raise of KeyError
  • Handle exceptions for default value

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Estimation

2 hours

@welcome
Copy link

welcome bot commented Mar 26, 2021

Hello there!👋 Welcome to the project!💖

Thank you and congrats🎉for opening your very first issue in this project. AnitaB.org is an inclusive community, committed to creating a safe and positive environment.🌸 Please adhere to our Code of Conduct.🙌 You may submit a PR if you like! If you want to report a bug🐞 please follow our Issue Template. Also make sure you include steps to reproduce it and be patient while we get back to you.😄

Feel free to join us on AnitaB.org Open Source Zulip Community.💖 We have different streams for each active repository for discussions.✨ Hope you have a great time there!😄

@codesankalp codesankalp added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Status: Available Issue was approved and available to claim or abandoned for over 3 days. labels Mar 26, 2021
@Rahulm2310 Rahulm2310 added the Type: Enhancement New feature or request. label Mar 26, 2021
@isabelcosta
Copy link
Member

Use get method in all code to avoid the raise of KeyError

Nice issue @codesankalp ! I did not think of that, it can be a good issue for mentorship-backend & bridge-in-tech-backend 😅

@codesankalp
Copy link
Member Author

Thanks for informing me @isabelcosta. I will create this issue there also.

@Aishwarya1396
Copy link

Hi, Is this issue still open? If so, can i please work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Status: Available Issue was approved and available to claim or abandoned for over 3 days. Type: Enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

4 participants