From d04ffc617e21b26f5cbf169c0552af10cc9cbc33 Mon Sep 17 00:00:00 2001 From: Tom Forbes Date: Wed, 23 Aug 2023 16:05:10 +0100 Subject: [PATCH] Add only python files link --- .github/workflows/unique_python_files.yml | 16 +++++++++++++++- src/main.rs | 10 +++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unique_python_files.yml b/.github/workflows/unique_python_files.yml index fec7a5a7..ab2ce5b8 100644 --- a/.github/workflows/unique_python_files.yml +++ b/.github/workflows/unique_python_files.yml @@ -49,8 +49,22 @@ jobs: github_token: ${{ github.token }} - name: Upload Assets + id: upload-assets uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ steps.get_release.outputs.upload_url }} asset_path: ${{ github.workspace }}/data/combined.parquet - asset_name: unique_python_files.parquet \ No newline at end of file + asset_name: unique_python_files.parquet + + - run: | + echo "${{ steps.upload-assets.outputs.browser_download_url }}" > links/only_python_files.txt + + - uses: EndBug/add-and-commit@v9 + with: + add: 'links/only_python_files.txt' + author_email: "41898282+github-actions[bot]@users.noreply.github.com" + author_name: "commit-bot" + message: "Add stats" + push: true + fetch: true + pull: '--rebase --autostash' diff --git a/src/main.rs b/src/main.rs index 9336d145..9b32ddf9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,13 +36,13 @@ async fn main() -> Result<()> { let download_dir = args.working_directory.join("downloads"); let output_dir = args.working_directory.join("output"); - let only_python_dir = args.working_directory.join("only_python"); + // let only_python_dir = args.working_directory.join("only_python"); let final_output_dir = args.working_directory.join("final"); let combined_parquet_file = args.working_directory.join("combined.parquet"); tokio::fs::create_dir_all(&args.working_directory).await?; tokio::fs::create_dir_all(&download_dir).await?; tokio::fs::create_dir_all(&output_dir).await?; - tokio::fs::create_dir_all(&only_python_dir).await?; + // tokio::fs::create_dir_all(&only_python_dir).await?; let urls_file = BufReader::new(File::open(&args.urls_file).await?); let mut lines = urls_file.lines(); @@ -60,11 +60,11 @@ async fn main() -> Result<()> { for (idx, url) in urls.into_iter().enumerate() { let path = download_dir.join(format!("url-{}.parquet", idx)); let output_dir = output_dir.join(format!("url-{}/", idx)); - let only_python_dir = only_python_dir.join(format!("url-{}/", idx)); + // let only_python_dir = only_python_dir.join(format!("url-{}/", idx)); download_file(&url, &path).await?; run_sql(&path, &output_dir, include_str!("../sql/unique_files.sql")).await?; - run_sql(&path, &only_python_dir, include_str!("../sql/only_python_files.sql")) - .await?; + // run_sql(&path, &only_python_dir, include_str!("../sql/only_python_files.sql")) + // .await?; tokio::fs::remove_file(&path).await?; }