Other articles

  1. Remotely working from home

    I've been working from home either partially or fully in the last few decades. So here are the most important tips/adjustments that will help you adjust quickly:

    1. Keep a morning routine - while a lot of people talk about working from home in pyjamas, it's easier if you just keep …
    read more
  2. How do I avoid cold starts in lambda?

    How do I avoid cold starts? Why do I see function calls to my lambda when nobody accessed it? What is keep_warm in zappa? How much does it cost me?

    Cold starts happen when your function hasn't been used for a while (the time is defined by AWS and, from …

    read more
  3. Where to get help for Zappa?

    Stuck with zappa? Assuming you're looking for help about the python lambda library and not the singer, then the following should help.

    The main documentation is the project's README: https://github.com/Miserlou/Zappa/blob/master/README.md - check the links section for particular integrations (ex: django, flask, alexa skills …

    read more
  4. Managing python dependencies in a reliable way

    Are you running your development environment with different packages than production? And your tests? Or even different parts of production?

    The common advice (example) is to pin versions of packages in a requirements.txt file (that means defining which particular version works for your program). That advice fails because the …

    read more
  5. Zappa, the packager

    Are you having problems with packaging your dependencies for a Lambda? You've done the AWS lambda python tutorials but now need to deal with something more complex? Do you just want to build a package to upload in the console or with terraform?

    Zappa is a great tool to handle …

    read more
  6. Changing function arguments and have tests pass because the function was mocked

    Recently I changed a function to receive a single argument instead of the previous two. Unfortunately that resulted in another function failing later. The issue wasn't lack of tests (that function had 100% coverage), but the way this function was tested.

    def test_that_function_was_called(mock_function):
        mock_function.assert_called_with …
    read more
  7. Deleting old items in SQLAlchemy

    Looking to delete old entries from a table because they've expired? Want to do it in an elegant way?

    I usually like to split this kind of functionality into two different parts: the method that does the deleting and a static method that can be invoked from cron, a celery …

    read more