Local development on Rancher Desktop

Through Hackernews I found out about the recent release of Rancher Desktop and I was curious if this would be a good alternative to Docker desktop for the develop of web applications on my local machine. I don’t really have a problem with Docker desktop, just good to try something new every now and then and it is open-source. Running some containers really gets some steam out of my Mac so hopefully it has some improvement there....

<span title='2021-10-16 04:07:47 +0000 UTC'>October 16, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;349 words&nbsp;·&nbsp;Joost

Async method decorator

Had a complete headache trying to figure out how a decorator as a class can maintain the possible async properties of a method. The solution is actually very simple. When called, use inspect.iscoroutinefunction to check whether it is a coroutine, and return again an async method! The example adds given paths to a registry, import inspect from functools import wraps paths_registry = [] class route(object): def __init__(self, path: str, **kwargs) -> None: self....

<span title='2021-09-24 04:07:47 +0000 UTC'>September 24, 2021</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;131 words&nbsp;·&nbsp;Joost

A Simple Factory for Domain Events

This is a simple demonstration of a domain event factory in Python. I assume you are familiar with the Factory Method Pattern. I also use the pydantic package for attribute validation. When implemented, we can use the factory to create immutable domain events with a homogenous data structure across instances of the same type. The metadata is generated by the underlying BaseEvent. In this approach we always produces complete events....

<span title='2021-01-25 11:37:35 +0100 +0100'>January 25, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;403 words&nbsp;·&nbsp;Joost

Python Immutable Objects

While reading into implementing DDD, there is often a plea for the use of immutable objects. The main motivation is that an object that is initially valid always remains valid; there is no later verification or validation required. Secondly, working with an immutable object cannot cause any side effects. Some data objects in Python are immutable, the dataclasses themselve are not. Let’s have this simple class: class SimpleClass: def __init__(self, attr1: int): self....

<span title='2021-01-13 11:37:35 +0100 +0100'>January 13, 2021</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;199 words&nbsp;·&nbsp;Joost

How does Airflow schedule Daylight Saving Time?

One morning you find out your favorite Airflow DAG did not ran that night. Sad… Six months later the task ran twice and now you understand: you scheduled your DAG timezone aware and the clock goes back and forth sometimes because of Daylight Saving Time. For example, in Central European Time (CET) on Sunday 29 March 2020, 02:00, the clocks were turned from “local standard time” forward 1 hour to 03:00:00 “local daylight time”....

<span title='2020-10-29 01:26:43 +0000 UTC'>October 29, 2020</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;326 words&nbsp;·&nbsp;Joost