🐛 Bug Fix: Inconsistent API Dev project #695
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for PyVerse 💡
Requesting to submit a pull request to the PyVerse repository.
Issue Title
Please enter the title of the issue related to your pull request.
✅ Fixes: #675
Info about the Related Issue
What's the goal of the project?
Describe the aim of the project.
An interactive web app that is used to analyze WhatsApp chats using NLP techniques
Name
Please mention your name.
Yash K. Saini
GitHub ID
Please mention your GitHub ID.
yashksaini-coder
Email ID
Please mention your email ID for further communication.
Enter your email ID here.
[email protected]
Identify Yourself
Mention in which program you are contributing (e.g., WoB, GSSOC, SSOC, SWOC).
Enter your participant role here.
GSSOC-Ext
Closes
Enter the issue number that will be closed through this PR.
Closes: #675
Describe the Add-ons or Changes You've Made
Give a clear description of what you have added or modified.
Describe your changes here.
This pull request includes several changes to improve the code quality, fix bugs, and enhance the functionality of the API. The most important changes include fixing a bug in the database initialization, improving error handling for duplicate entries, and updating the database models.
Bug Fixes and Improvements:
api_dev/database.py
: Ensured database tables are created when the engine is initialized by addingBase.metadata.create_all(bind=engine)
.api_dev/main.py
: Added error handling for duplicate book entries usingIntegrityError
in thecreate_book
endpoint. [1] [2]Code Quality Enhancements:
api_dev/database.py
: Improved comments for better readability and fixed typos in the descriptions.api_dev/main.py
: Simplified and clarified comments in API endpoints and improved Pydantic model configuration.Database Model Updates:
api_dev/models.py
: Increased the string length for thetitle
column and removed the unique constraint on theauthor
column in theBook
model.Type of Change
Select the type of change:
How Has This Been Tested?
Describe how your changes have been tested.
On my codespace
Checklist
Please confirm the following:
@UTSAVS26 I have completed teh bug fixes, with new properly feat to the chat analayzer web app. Reveiw this PR, and aa proper labels to it, also assign me on this PR.