From 7ff0716386cfb813034a3447949d0906ae6e09d1 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Aug 2024 22:59:33 +0100 Subject: ci: add dev-test.yml --- .github/workflows/dev-test.yml | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/dev-test.yml diff --git a/.github/workflows/dev-test.yml b/.github/workflows/dev-test.yml new file mode 100644 index 0000000..ebdad5f --- /dev/null +++ b/.github/workflows/dev-test.yml @@ -0,0 +1,48 @@ +name: Development CI + +on: + pull_request: + branches: + - development + push: + branches: + - development + +jobs: + validate-and-test: + name: Validate Terraform and Run Tests + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + + - name: Terraform Init + working-directory: terraform + run: terraform init -backend=false + + - name: Terraform Validate + working-directory: terraform + run: terraform validate + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-testdox + pip install -r requirements.txt + + - name: Run pytest + run: pytest tests/ -vvrP --testdox + continue-on-error: true + id: pytest + + - name: Check on failures + if: steps.pytest.outcome == 'failure' + run: exit 1 -- cgit v1.2.3 From 95e5e49aa544ec2bda244a1225a2a467983db22a Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Aug 2024 23:04:55 +0100 Subject: ci: update dev-test.yml --- .github/workflows/dev-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dev-test.yml b/.github/workflows/dev-test.yml index ebdad5f..a1e64b2 100644 --- a/.github/workflows/dev-test.yml +++ b/.github/workflows/dev-test.yml @@ -12,6 +12,7 @@ jobs: validate-and-test: name: Validate Terraform and Run Tests runs-on: ubuntu-latest + environment: testing steps: - name: Checkout Repo uses: actions/checkout@v4 -- cgit v1.2.3 From c600a7694f770954e4c8b836de5640024d61c4e6 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Aug 2024 23:07:55 +0100 Subject: ci: rm dev-test.yml It's in the wrong branch... --- .github/workflows/dev-test.yml | 49 ------------------------------------------ 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/dev-test.yml diff --git a/.github/workflows/dev-test.yml b/.github/workflows/dev-test.yml deleted file mode 100644 index a1e64b2..0000000 --- a/.github/workflows/dev-test.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Development CI - -on: - pull_request: - branches: - - development - push: - branches: - - development - -jobs: - validate-and-test: - name: Validate Terraform and Run Tests - runs-on: ubuntu-latest - environment: testing - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Install Terraform - uses: hashicorp/setup-terraform@v3 - - - name: Terraform Init - working-directory: terraform - run: terraform init -backend=false - - - name: Terraform Validate - working-directory: terraform - run: terraform validate - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - pip install pytest pytest-testdox - pip install -r requirements.txt - - - name: Run pytest - run: pytest tests/ -vvrP --testdox - continue-on-error: true - id: pytest - - - name: Check on failures - if: steps.pytest.outcome == 'failure' - run: exit 1 -- cgit v1.2.3 From da3d85dd2dc515226d16992c5f63b2a8b02a0a38 Mon Sep 17 00:00:00 2001 From: Ellie Date: Wed, 21 Aug 2024 13:41:01 +0100 Subject: add dim tables: design, staff, currency, location (wip) --- src/fact-sales-order.py | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/fact-sales-order.py diff --git a/src/fact-sales-order.py b/src/fact-sales-order.py new file mode 100644 index 0000000..a143889 --- /dev/null +++ b/src/fact-sales-order.py @@ -0,0 +1,54 @@ +import pandas as pd +from src.transform_lambda import get_dataframes + +dict_of_df = get_dataframes() # {"design": "design dataframe", "address": "address dataframe", ....} + + +# iterates through each dataframe in the list of dataframes and assigns them to a variable +df_design = dict_of_df[design] +df_currency = dict_of_df[currency] +df_address = dict_of_df[address] +df_staff = dict_of_df[staff] +df_department = dict_of_df[department] +df_counterparty = dict_of_df[counterparty] + + +# creates the dim_design dataframe +dim_design = df_design["design_id", "design_name", "file_name", "file_location"] + +# creates the dim_staff dataframe +staff_department = pd.merge(df_staff, df_department, on='department_id', how="outer") +dim_staff = staff_department['staff_id', 'first_name', 'last_name', 'department_name', 'location', 'email_address'] + +# creates the dim_currency dataframe +# currency names currently hardcoded and not taken from database, is this viable/how else to do this? +d = {"currency_id": [1, 2, 3], "currency_code": ["GBP", "USD", "EUR"], "currency_name": ["Pound", "US Dollar", "Euro"]} +currency_names = pd.DataFrame(data=d) +join_currency = pd.merge(df_currency, currency_names, on="currency_name", how="outer") +dim_currency = join_currency["currency_id", "currency_code", "currency_name"] + +# creates the dim_location dataframe +# need to change address id to location id +"dim_location dataframe: (location_id, address_line_1, address_line_2, district, city, postal code, country, phone)" +dim_location = df_address["address_id", "address_line_1", "address_line_2", "district", "city", "postal_code" "country", "phone"] + + + + + + + + + +# creates the dim_counterparty dataframe +# counterparty_address = pd.merge(df_counterparty, df_address, left_on="legal_address_id", right_on='address_id', how="outer") + +# dim_counterparty = df_counterparty["counterparty_id", "counterparty_legal_name", "counterparty_legal_address_line_1", +# "counterparty_legal_address_line_2", "counterparty_legal_district", "counterpart_legal_city", +# "counterparty_legal_postal_code", "counterparty_legal_country", "counterparty_legal_phone_number"] + + +# TO DO: +# dim_location +# dim_date +# fact_sales_order \ No newline at end of file -- cgit v1.2.3