OPI Blog
Learn from experts in their fields

Browsing Tags: Modern API

Resetting Database Between Spring Integration Tests
When tasked with having to write an integration test or a Spring Webflux test that uses a database, it can be cumbersome to have to reset the database between each test by using @DirtiesContext. Using ...
Feb 23, 2021
Jolt custom java transform
Jolt is a JSON to JSON transformation library where the transform is defined in JSON. It’s really good at reorganizing the json data and massaging it into the output JSON you need. Sometimes, you just ...
Feb 4, 2021
Jolt transform both fields required
Jolt is a JSON to JSON transformation library where the transform is defined in JSON. As an example you may want to transform the latitude and longitude fields into a location object containing those fields. ...
Jan 26, 2021
Jolt transform a default value dependent on another field
Jolt is a JSON to JSON transformation library where the transform is defined in JSON Sometimes you need to add a default value along with a data transformation. The straight forward way to do this ...
Nov 24, 2020
Performance Test Liquibase Update
When doing a liquibase update to a database if you’re having performance issues, it can be hard to find out which updates are causing problems. If you need to measure the time to apply each ...
Aug 26, 2020
Large Data Migrations Django
Been working with a Django project with a large dataset and wanted to insert a bunch of inter-related data in a migration. Where Django has support for data migrations via the migration framework, it doesn’t ...
Local Testing for GCP Cloud Functions
It’s easy to write Google Cloud Functions in Python. The trick is to put a function that takes a single object in a file called main.py. Their example is simply: def hello_world(request): """Responds to any ...
Sep 24, 2019
Some Command Line Tools for AWS
I’ve been working a lot in AWS lately and while I like the tech stack, going through the console to do stuff is really annoying to a command-line junkie such as myself. I could cook ...
Managing Python environments with direnv
A few months ago I discovered direnv and was surprised how I got along so well with out it. From the website, direnv ” allows project-specific environment variables without cluttering the ~/.profile file.” I used ...
Creating dynamic headers in Reportlab
When writing code to make a report, you never truly know what you are going to get into. In a recent Python project, I was using the excellent ReportLab libraryand things were going smoothly. But then ...