Skip to content

Instantly share code, notes, and snippets.

View ckingbailey's full-sized avatar

ckingbailey

View GitHub Profile
@ckingbailey
ckingbailey / nested_list_comprehension.py
Created November 12, 2020 02:40
I don't get the logic of nested list comprehensions in Python
""" The way nested list comprehensions work looks backwards to me.
I use this pattern a lot to create a collection of DataFrames from stub data
in writing tests for AWS Glue/PySpark ETL jobs.
"""
table_group = [
{
'database': 'ancient_legends_tier_1',
'table_name': 'wizards',
'columns': {
'id': 'int',