Skip to content

Commit

Permalink
fix: auto formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
leomaurodesenv committed Nov 2, 2023
1 parent 7f6c326 commit 63c3f70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# Give the default GITHUB_TOKEN write permission to commit and push the
# updated CHANGELOG back to the repository.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
This is a learning repository about DVC Data Version Control and Luigi Pipelines

- luigi, dvc, pre-commit
- setup https://pre-commit.com/
- setup https://github.com/Kaggle/kaggle-api
- `kaggle competitions download -c sentiment-analysis-on-movie-reviews -p data`
15 changes: 11 additions & 4 deletions source/get_raw_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@
import luigi
import zipfile


class ExtractRawData(luigi.Task):
data_path = luigi.Parameter(default="../data/sentiment-analysis-on-movie-reviews.zip")
"""
Extract raw data from zip file
"""

data_path = luigi.Parameter(
default="../data/sentiment-analysis-on-movie-reviews.zip"
)

def output(self):
return {
"test": luigi.LocalTarget('../data/output/test.tsv.zip'),
"train": luigi.LocalTarget('../data/output/train.tsv.zip'),
"test": luigi.LocalTarget("../data/output/test.tsv.zip"),
"train": luigi.LocalTarget("../data/output/train.tsv.zip"),
}

def run(self):
# Check if data file exists
assert os.path.exists(self.data_path)

# Unzip data file
with zipfile.ZipFile(self.data_path, 'r') as zip_ref:
with zipfile.ZipFile(self.data_path, "r") as zip_ref:
zip_ref.extractall("../data/output/")

0 comments on commit 63c3f70

Please sign in to comment.