This week moved from flat aggregation to richer shapes: sets for dedup, a dict-keyed-by-source grouping, a tagged matrix, and per-API try/except. How is the data modeling feeling?
Picking the right shape per problem is the hard part. Flat list when downstream is uniform, dict-of-lists when branching by source matters, tagged matrix when both are needed.
Exactly — the quiz tests that decision. Plus the try/except discipline: when to catch broadly, when to use a sentinel value, why per-API isolation matters.
The sentinel-vs-zero question — I want to make sure I nail it.
Think about what distinguishes 'no data' from 'fetch failed' — the answer follows.
Five functions moving from pure aggregation to production-shaped resilience:
dedup_across_sources — set for membership, list for ordergroup_by_source — dict of lists keyed by gmail, calendar, tasksbuild_source_matrix — list of {source, content, id} rowssafe_fetch_with_default — try/except with configurable fallbacksafe_multi_source_counts — per-API try/except, -1 sentinel per failed sourceKey idea: wrap API calls in try/except so one failure doesn't cascade.
Create a free account to get started. Paid plans unlock all tracks.
This week moved from flat aggregation to richer shapes: sets for dedup, a dict-keyed-by-source grouping, a tagged matrix, and per-API try/except. How is the data modeling feeling?
Picking the right shape per problem is the hard part. Flat list when downstream is uniform, dict-of-lists when branching by source matters, tagged matrix when both are needed.
Exactly — the quiz tests that decision. Plus the try/except discipline: when to catch broadly, when to use a sentinel value, why per-API isolation matters.
The sentinel-vs-zero question — I want to make sure I nail it.
Think about what distinguishes 'no data' from 'fetch failed' — the answer follows.
Five functions moving from pure aggregation to production-shaped resilience:
dedup_across_sources — set for membership, list for ordergroup_by_source — dict of lists keyed by gmail, calendar, tasksbuild_source_matrix — list of {source, content, id} rowssafe_fetch_with_default — try/except with configurable fallbacksafe_multi_source_counts — per-API try/except, -1 sentinel per failed sourceKey idea: wrap API calls in try/except so one failure doesn't cascade.