Skip to content

Conversation

@chinandrew
Copy link
Contributor

@chinandrew chinandrew commented Jan 20, 2021

Convert the columns_and_types variable from a list of (csv headers, data types) to a list of (csv headers, sql column name, data type) and then use that mapping later so the specification is not order specific. This PR is for the covid_hosp folder.

This also resolves two issues I stumbled upon:

  1. the ddl documentation was missing the new rows
  2. the state_daily files were merged after the pytest compatibility PR and thus would fail due to missing imports

TODO:

  • add a test that fails on main due to column order but passes here. ended up just rearranging some columns that caused main integration tests to fail but pass on this branch

Fixes #387

@chinandrew chinandrew requested a review from krivard January 20, 2021 20:01
@chinandrew chinandrew changed the title [DRAFT] Add sql column names to csv column mapping Add sql column names to csv column mapping Jan 20, 2021
@chinandrew chinandrew marked this pull request as ready for review January 20, 2021 21:40
Copy link
Contributor

@krivard krivard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional refinement -- lmk your verdict and I can merge or hold off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

covid_hosp is inserting data under the wrong columns

2 participants