Skip to content

Commit

Permalink
fix: try running in python interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
gitfrosh committed Apr 16, 2024
1 parent 9bd0fd9 commit c7b1406
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/data-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,10 @@ jobs:
- name: Install pandas
run: pip install pandas


- name: Convert CSV to JSON
run: |
import os
import pandas as pd
os.makedirs('db/json', exist_ok=True)
csv_files = [f for f in os.listdir('db/csv') if f.endswith('.csv')]
python -c "import os; import pandas as pd; os.makedirs('db/json', exist_ok=True); csv_files = [f for f in os.listdir('db/csv') if f.endswith('.csv')]; [pd.read_csv(f'db/csv/{file}').to_json(f'db/json/{file.replace('.csv', '.json')}', orient='records', lines=True) for file in csv_files]"
for file in csv_files:
df = pd.read_csv(f'db/csv/{file}')
json_path = f'db/json/{file.replace(".csv", ".json")}'
df.to_json(json_path, orient='records', lines=True)
print("Conversion complete.")
- name: Upload JSON files as artifacts
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion db/csv/quotes.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dialog,movie,character,_id
Deagol!,ObjectId(5cd95395de30eff6ebccde5d),ObjectId(5cd99d4bde30eff6ebccfe9e),ObjectId(5cd96e05de30eff6ebcce7e9)
Deagol!!,ObjectId(5cd95395de30eff6ebccde5d),ObjectId(5cd99d4bde30eff6ebccfe9e),ObjectId(5cd96e05de30eff6ebcce7e9)
Deagol!,ObjectId(5cd95395de30eff6ebccde5d),ObjectId(5cd99d4bde30eff6ebccfe9e),ObjectId(5cd96e05de30eff6ebcce7ea)
Deagol!,ObjectId(5cd95395de30eff6ebccde5d),ObjectId(5cd99d4bde30eff6ebccfe9e),ObjectId(5cd96e05de30eff6ebcce7eb)
Give us that! Deagol my love,ObjectId(5cd95395de30eff6ebccde5d),ObjectId(5cd99d4bde30eff6ebccfe9e),ObjectId(5cd96e05de30eff6ebcce7ec)
Expand Down

0 comments on commit c7b1406

Please sign in to comment.