Celery is the default choice whenever there is a need to introduce a worker queue into Python projects. Not exactly ideal, but it’s feature-rich, gets the job done, and can be reliable when being used properly . Over the years of working with Celery, I’ve developed certain rules that I would recommend one to follow for building reliable background pipelines. Prefer late acknowledgement…
When I first started using Github Copilot, I felt quite uplifted about it. I set up the plugin in my editor (I use Neovim with copilot.vim plugin), and started enjoying the incredible amount of additional productivity I now possess. I no longer need to type the whole block of code that I came up with in my brain, all I need is a little hint to the model and everything is magically there.…
Task prioritization can be an effective technique to ensure the most critical tasks are processed in time. There are other ways to achieve this, like using dedicated workers, but prioritizing is arguably the simplest, and in many cases, the most cost-effective approach. Celery supports task prioritization natively, but it works differently depending on the broker you use. If you use RabbitMQ, for…
Mocks are a powerful concept in testing. They are one of several types of test doubles , which are objects that can be used in place of real objects in your tests. Mocks are used to isolate the code under test from the rest of the system, and to verify that the code under test interacts with its dependencies correctly. However, if not used properly, mocks can lead to false positives in your tests.…
I graduated from a university with a degree in Finance and immediately started my career in investment banking. After about 7 years of working in the industry, the realization came to me that it wasn’t for me. So in my late 20s I decided to change my career path completely and become a software engineer. I did not have much time nor motivation to obtain another college degree, so I decided…
If you follow the Test-driven Development practice in your Python projects, you need to run your test suite often . Having to run it manually can become tedious. You can configure handy shortcuts in your favorite IDE to make the process easier. But there is even better way using pytest-watcher . What is pytest-watcher ? pytest-watcher is a continuous test runner for Python projects that reruns…
When building asynchronous applications, oftentimes you need to limit the number of simultaneous connections to a shared resource. It can be your internal server, or an API that has usage limits. asyncio library provides a dedicated synchronization primitive Semaphore created exactly for this purpose. However, let’s first try to solve this problem without using it, in order to fully…
I recently discovered the Advent of Code project for myself and I absolutely loved it. At first glance, it seemed similar to solving Leetcode problems. However, after trying it for a few days now I realized that I like the experience much more. In this short blog post I’ll try to break down main advantages that I see over Leetcode : No online editor You don’t have to use the poor…
If you are working on a large Django project, you probably have lots of automated tests running as part of your CI/CD process. As long as tests run fast, everyone is happy. But as your application grows in complexity, your tests start to take more and more time to run and eventually become a real bottleneck. In this post, I will share some ideas that can help you optimize runtime of your test…
Hi, I’m Olzhas Arystanov . I’m a software engineer focused on, but not limited to backend development. I am passionate about building all kinds of software, from small CLI applications to databases and distributed systems. I mainly program in Python, Golang, and C. I also know Typescript and Lua. You can find me on: Github LinkedIn