Comments (6)
Hi @66dexmg π
Do you get a specific error when doing this?
from building-data-science-applications-with-fastapi.
@frankie567
Yes,it may be a small mistake.In next row,i can only get first post which was not the post i updated because the function 'execute' always return the number 1.
from building-data-science-applications-with-fastapi.
You're perfectly right @66dexmg, that's actually quite a dumb mistake from my part. You can find the correct, fixed code here: e95e35f
I'll now contact Packt to coordinate a proper erratum. Thank you for raising this π
from building-data-science-applications-with-fastapi.
@frankie567
You are welcome.You have written a fantastic book although I had waitted its Chinese translation for a long timeπ.Any oriented advice for me after I finish it?
from building-data-science-applications-with-fastapi.
Thanks!
Well, my main advice to fellow developers is usually: practice. It's by experimenting a lot, building new things, observe what others are doing in their code that you'll make progress and gain experience.
That said, there are a few subjects I didn't have the opportunity to show in the book that are interesting:
- Worker process: when you have long-running operations to perform, it's usually a good idea to offload it to a background process, different from your web server. This way, you keep your API fast and responsive while being able to perform large jobs (data extraction, heavy machine learning...) in the background. In Python, this can be achieved with Celery or Dramatiq.
- I have a quick introduction to those concepts in this blog post: https://www.francoisvoron.com/blog/create-deploy-reliable-data-ingestion-service-fastapi-sqlmodel-dramatiq
- Structured logging: for robust production systems, it's important to have clear logs to monitor what's going on. An interesting pattern is to structure those logs using JSON objects rather than just free-text logs. It'll help you search through them or index them correctly into a log ingestion platform like Logstash. Libraries to help you with this: structlog or loguru.
- Monitoring: it can also be valuable to have relevant metrics about your system (speed, number of operations...). A good approach is to set-up Prometheus, which is a lightweight but powerful way to define and report metrics. It's quite simple to add it in your Python codebase and then be able to properly query and display this data in a Grafana dashboard.
from building-data-science-applications-with-fastapi.
Thanks a lot!
from building-data-science-applications-with-fastapi.
Related Issues (13)
- What is the use of fastapi.params? HOT 1
- Chapter 11 ndarray.copy is not deep copy HOT 5
- Refering to python built-in `id` instead of `comment.post_id` in HTTPException? HOT 2
- [Chapter 6] comment argument in create_comment() as CommentCreate instance HOT 1
- Chapter 9 external api test is missing the test function HOT 1
- Delete irrelevant files from the project
- Discussion: consider merging `with` statements HOT 2
- Too much data for declared Content-Length error in DELETE post (Chapter 3) HOT 1
- Chapter 4 `PostPartialUpdate` model errors after meeting `response_model=PostPublic` HOT 3
- Chapter3_headers_cookies_02.py calling from automatic docs forces user-agent entry that is ignored HOT 1
- How does the way the app is run affect whether book code works? HOT 4
- Directory problems in Chapter 6 Alembic section HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from building-data-science-applications-with-fastapi.