From 31d511f354c999e1cba572b4c48eea14655f9622 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 12 Apr 2024 01:10:31 +0530 Subject: [PATCH 1/3] etl exercise --- practice/etl/etl.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/practice/etl/etl.py b/practice/etl/etl.py index 993dca2..cbe310c 100644 --- a/practice/etl/etl.py +++ b/practice/etl/etl.py @@ -1,2 +1,9 @@ def transform(legacy_data): - pass + transformed = {} + for point, letters in legacy_data.items(): + for letter in letters: + letter_lower = letter.lower() + if letter_lower not in transformed: + transformed[letter_lower] = point + return transformed + From 53097ff6583777163a9e95fdf952c104f3a40d84 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Mon, 22 Apr 2024 02:27:39 +0530 Subject: [PATCH 2/3] run impacted test only --- .github/workflows/python-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 48d1bde..a4e04c8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -30,7 +30,8 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest run: | - pytest --continue-on-collection-errors + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + git diff origin/main HEAD --name-only -- practice | xargs dirname | sort | uniq | xargs pytest - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names From a2d8de9b7d4c657699b0b11fb52de2f863a218da Mon Sep 17 00:00:00 2001 From: Abhishek Date: Mon, 22 Apr 2024 02:34:58 +0530 Subject: [PATCH 3/3] resolved conflicts --- .github/workflows/python-app.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index a4e04c8..e1ba390 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -30,11 +30,11 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest run: | - git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - git diff origin/main HEAD --name-only -- practice | xargs dirname | sort | uniq | xargs pytest + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + git diff origin/main HEAD --name-only -- practice | xargs dirname | sort | uniq | xargs pytest - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics \ No newline at end of file