Skip to content

Commit

Permalink
Add only python files link
Browse files Browse the repository at this point in the history
  • Loading branch information
orf committed Aug 23, 2023
1 parent 9a2b7dd commit d04ffc6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/unique_python_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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'
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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?;
}

Expand Down

0 comments on commit d04ffc6

Please sign in to comment.