Study Guide: Week 4#

Open-ended questions on the material from week 4. The exam asks multiple-choice versions of questions like these. No answers are given: each question can be answered in a few sentences from the pages listed under its heading. The exam’s format is described in Exam Preparation.

Databento and Data APIs#

Read: Databento, Pulling Market Data From Databento, and Agenda Item 1 of the week 4 chapter.

  1. WRDS authenticates you with a password kept in .pgpass. Databento issues API keys instead. Why create a separate key for each project?

  2. What does Databento’s metadata.get_cost return, and how can a pull use it to make sure it never spends money?

  3. A Databento request names a dataset, a schema, and the symbols. What does the schema choose?

  4. What does Databento’s Python SDK add on top of its raw HTTP API, and why does it matter that the raw API exists?

  5. What is a continuous futures series, and what decision does building one require? (Read: LSEG Datastream.)

Static Sites and GitHub Pages#

Read: GitHub Pages and Tearsheets and the “Key Concepts” in the github_actions/ examples.

  1. What is a static website? Why can you open one from your laptop with no server running?

  2. What is GitHub Pages? What kind of site can it host, and what can it not run?

  3. What does an empty .nojekyll file at the root of a GitHub Pages site do? What can go wrong without it?

Keeping Output Out of main#

Read: Agenda Item 4 of the week 4 chapter.

  1. The course’s .gitignore lists docs/, the folder chartbook docs build writes. Give two reasons not to commit a rebuilt site to main.

  2. A gh-pages branch is kept two commits ahead of main by rebasing it and force-pushing. What does a force-push do, and when is it safe?

CI/CD with GitHub Actions#

Read: the github_actions/ examples in the in-class repository, Agenda Item 5 of the week 4 chapter, and Scheduling Recurring Tasks with Cron.

  1. What happens, step by step, when you push a commit to a repository that has the workflow below?

on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: pip install -r requirements.txt
      - run: pytest
  1. A workflow file begins with the lines below. Name the three events that start the workflow, and say when each one happens.

on:
  push:
    branches: [main]
  schedule:
    - cron: '0 22 * * 0'
  workflow_dispatch: {}
  1. A pipeline that runs on GitHub Actions needs an API key. Where should the key be stored, and why not in the workflow file or in a committed .env file?

  2. What is the difference between a GitHub-hosted runner and a self-hosted one? Why does the course’s autograder run on a self-hosted runner?