Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import data every time #2

Merged
merged 11 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ jobs:
- name: Setup Docker
uses: docker/setup-buildx-action@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Python Dependencies
run: |
pip install psycopg2-binary pandas sqlalchemy

- name: Start PostgreSQL
working-directory: static/relational/postgres
run: |
Expand All @@ -29,6 +38,15 @@ jobs:
sleep 2
done

- name: Load Data into PostgreSQL
working-directory: static/relational/postgres
run: |
python import-data.py ../../../relational/dataset \
--database postgres \
--user postgres \
--port 5433 \
--password postgres

- name: Setup NDC Postgres
working-directory: static/relational/postgres
env:
Expand Down
22 changes: 22 additions & 0 deletions relational/dataset/001_MediaType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"MediaTypeId": 1,
"Name": "MPEG audio file"
},
{
"MediaTypeId": 2,
"Name": "Protected AAC audio file"
},
{
"MediaTypeId": 3,
"Name": "Protected MPEG-4 video file"
},
{
"MediaTypeId": 4,
"Name": "Purchased AAC audio file"
},
{
"MediaTypeId": 5,
"Name": "AAC audio file"
}
]
102 changes: 102 additions & 0 deletions relational/dataset/002_Genre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[
{
"GenreId": 1,
"Name": "Rock"
},
{
"GenreId": 2,
"Name": "Jazz"
},
{
"GenreId": 3,
"Name": "Metal"
},
{
"GenreId": 4,
"Name": "Alternative & Punk"
},
{
"GenreId": 5,
"Name": "Rock And Roll"
},
{
"GenreId": 6,
"Name": "Blues"
},
{
"GenreId": 7,
"Name": "Latin"
},
{
"GenreId": 8,
"Name": "Reggae"
},
{
"GenreId": 9,
"Name": "Pop"
},
{
"GenreId": 10,
"Name": "Soundtrack"
},
{
"GenreId": 11,
"Name": "Bossa Nova"
},
{
"GenreId": 12,
"Name": "Easy Listening"
},
{
"GenreId": 13,
"Name": "Heavy Metal"
},
{
"GenreId": 14,
"Name": "R&B/Soul"
},
{
"GenreId": 15,
"Name": "Electronica/Dance"
},
{
"GenreId": 16,
"Name": "World"
},
{
"GenreId": 17,
"Name": "Hip Hop/Rap"
},
{
"GenreId": 18,
"Name": "Science Fiction"
},
{
"GenreId": 19,
"Name": "TV Shows"
},
{
"GenreId": 20,
"Name": "Sci Fi & Fantasy"
},
{
"GenreId": 21,
"Name": "Drama"
},
{
"GenreId": 22,
"Name": "Comedy"
},
{
"GenreId": 23,
"Name": "Alternative"
},
{
"GenreId": 24,
"Name": "Classical"
},
{
"GenreId": 25,
"Name": "Opera"
}
]
Loading
Loading