Question: We are in the process of designing an ETL process, where we’ll be getting a daily account file (maybe half a million records, could grow) from client and we’ll be loading that file to our database.

Our current process splits the file into smaller files and load it to staging...sometime or if the process fails, we try to figure out how many records we have processed and then start again from that point. Is there any other better alternative to this problem? 

We are thinking about using Kafka. I’m pretty new to Kafka. I would really appreciate some feedback if kafka is the way to go or we’re just over-killing a simple ETL process where we just load the data to a staging table and finally to destination table.

Answer: 
you can use a [conditional expression](https://docs.python.org/3/reference/expressions.html#conditional-expressions) to decide what element to store in your list:

```
from random import choice

[a if a else [choice(b)] for a, b in zip(A, B)]

```
You can use the `or` operator to fall back to a random selection from `B` using `random.choices`:

```
from random import choices
[a or choices(b) for a, b in zip(A, B)]

```