Skip to content

Commit

Permalink
Resolving pyspark issue
Browse files Browse the repository at this point in the history
  • Loading branch information
siliconshells committed Nov 29, 2024
1 parent 48cc498 commit 2342d07
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 18,045 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ COPY requirements.txt /tmp/
COPY Makefile /tmp/
RUN su $USER -c "/usr/bin/python3 -m venv /home/${USER}/venv" \
&& su $USER -c "${VENV_PATH}/bin/pip --disable-pip-version-check --no-cache-dir install -r /tmp/requirements.txt" \
&& rm -rf /tmp/requirements.txt
&& rm -rf /tmp/requirements.txt
19 changes: 7 additions & 12 deletions .github/workflows/workflow.yml → .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
name: CI
on:
push:
branches: ["main"]
branches: [ "main" ]
pull_request:
branches: ["main"]
branches: [ "main" ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: install packages
run: make install
- name: format
run: make format
- name: lint
run: make lint
- name: test
run: make test
- name: extract
run: make extract
- name: transfer and load
run: make transform_and_load
- name: query
run: make query
- name: format
run: make format
- name: deploy
run: make deploy
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
install:
pip install --upgrade pip &&\
pip install -r requirements.txt

test:
python -m pytest -vv --cov=main --cov=mylib test_*.py

format:
black *.py

lint:
#disable comment to test speed
#pylint --disable=R,C --ignore-patterns=test_.*?py *.py mylib/*.py
#ruff linting is 10-100X faster than pylint
ruff check *.py mylib/*.py

container-lint:
docker run --rm -i hadolint/hadolint < Dockerfile

refactor: format lint

deploy:
#deploy goes here

all: install lint test format deploy
18,026 changes: 0 additions & 18,026 deletions data/air_quality.csv

This file was deleted.

Binary file removed data/air_quality.db
Binary file not shown.
12 changes: 7 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# testing was saying i needed pandas...
pandas
#devops
black==22.3.0
click==8.1.3
Expand All @@ -10,9 +12,9 @@ boto3==1.24.87
#web
fastapi==0.85.0
uvicorn==0.18.3
# other dependencies
databricks-sql-connector
databricks
pyspark
#other dependencies
requests
tabulate
pyspark
tabulate


3 changes: 2 additions & 1 deletion setup.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source /home/codespace/venv/bin/activate
#append it to bash so every shell launches with it
echo 'source /home/codespace/venv/bin/activate' >> ~/.bashrc
echo 'source /home/codespace/venv/bin/activate' >> ~/.bashrc
make install-tensorflow

0 comments on commit 2342d07

Please sign in to comment.