What is the difference between ThreadPoolExecutor and ThreadPool ?


Verbatim copy of my StackOverflow answer since I’d rather point people here and not to yet another source of user contributed content for OpenAI.

The multiprocessing.dummy.ThreadPool is a copy of the multiprocessing.Pool API which uses threads rather than processes, leading to some weirdness since thread and processes are very different, including returning a AsyncResult type which only it understands.

Read more ⟶

Installing ODBC Driver for SQL Server on Debian Buster, Bullseye or Bookworm, the Debian way


Microsoft offers installation instructions for its ODBC Driver for SQL Server on several Linux distributions, including Debian, which I tend to use for docker images.

The instructions are very simple:

Read more ⟶

AWS SAM template with YAML boolean environment variable


Recently, I reviewed an AWS SAM template in which one of my team members added an environment variable ENABLE_FOO (name isn’t important) with the value true.

1
2
3
4
5
6
7
8
Resources:
  SomeVeryInterestingFunction:
    Type: AWS::Serverless::Function
    Properties:
      Environment:
        Variables:
          ENABLE_FOO: true

Unquoted string are common in YAML, but this unquoted true isn’t a string, it’s a boolean, a subtle difference they had not considered.

Read more ⟶

git lol[a] - git trees in the terminal


I like the terminal, it’s where I spend most of my time when working, and this little git log trick is just so elegant I just want to share it.

Read more ⟶

Remove mypy [attr-defined] error from SQLAlchemy empty class


In SQLAlchemy, empty classes are commonly used for imperative mapping and database reflection.

If you’re using mypy, then when you access their attributes, you will get an [attr-defined] error which can (and will) very quickly drown the useful mypy errors into a wall of noise you won’t even look at.

Read more ⟶