-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local development fixes (lint, compose, deps) (#8486)
- Loading branch information
Showing
20 changed files
with
159 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,68 @@ | ||
|
||
import os | ||
import pandas as pd | ||
|
||
csv_path = os.path.abspath(os.path.join(os.getcwd(), '..', 'local-csv')) | ||
csv_path = os.path.abspath(os.path.join(os.getcwd(), "..", "local-csv")) | ||
# csv_path = os.path.abspath(os.path.join(os.getcwd(), '..', 'production-csv')) | ||
|
||
|
||
def get_all_csvs(): | ||
# Get the list of all files and directories | ||
dir_list = os.listdir(csv_path) | ||
print('Num files and directories in', csv_path, 'is', len(dir_list)) | ||
print("Num files and directories in", csv_path, "is", len(dir_list)) | ||
return dir_list | ||
|
||
|
||
def generate_aggregate_csv(): | ||
csvs = get_all_csvs() | ||
# print(csvs) | ||
dfs = [pd.read_csv('../local-csv/' + csv) for csv in csvs] | ||
dfs = [pd.read_csv("../local-csv/" + csv) for csv in csvs] | ||
# dfs = [pd.read_csv('../production-csv/' + csv) for csv in csvs] | ||
# print(dfs) | ||
final_result = pd.concat(dfs) | ||
final_result = final_result.groupby(final_result.track_id).first() | ||
# print(final_result) | ||
print(final_result.size) | ||
|
||
try: | ||
final_result.pop('Unnamed: 0') | ||
try: | ||
final_result.pop("Unnamed: 0") | ||
except: | ||
pass | ||
|
||
try: | ||
final_result.pop('Unnamed: 0.1') | ||
final_result.pop("Unnamed: 0.1") | ||
except: | ||
pass | ||
|
||
try: | ||
final_result.pop('Unnamed: 0.2') | ||
final_result.pop("Unnamed: 0.2") | ||
except: | ||
pass | ||
|
||
final_result = final_result.sort_values(by=['track_id']) | ||
final_result.to_csv('../track_cids.csv') | ||
final_result = final_result.sort_values(by=["track_id"]) | ||
final_result.to_csv("../track_cids.csv") | ||
# print(final_result) | ||
|
||
|
||
def get_missing_track_cids_csv(): | ||
final_result_read = pd.read_csv('../track_cids.csv') | ||
final_result_read = pd.read_csv("../track_cids.csv") | ||
# print(final_result_read) | ||
|
||
all_track_ids_read = pd.read_csv('../all_track_ids.csv').sort_values(by=['TrackId']) | ||
all_track_ids_read = pd.read_csv("../all_track_ids.csv").sort_values(by=["TrackId"]) | ||
# print(all_track_ids_read) | ||
|
||
# print(final_result_read[['TrackId']].compare(all_track_ids_read[['TrackId']])) | ||
# print(final_result_read['TrackId'].isnotin(all_track_ids_read['TrackId']).value_counts()) | ||
|
||
the_missing = all_track_ids_read[~all_track_ids_read['TrackId'].isin(final_result_read['track_id'])].sort_values(by=['TrackId']) | ||
the_missing.to_csv('../missing_cids.csv', index=False, header=False) | ||
the_missing = all_track_ids_read[ | ||
~all_track_ids_read["TrackId"].isin(final_result_read["track_id"]) | ||
].sort_values(by=["TrackId"]) | ||
the_missing.to_csv("../missing_cids.csv", index=False, header=False) | ||
|
||
|
||
def main(): | ||
generate_aggregate_csv() | ||
get_missing_track_cids_csv() | ||
|
||
if __name__ == '__main__': | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"steps": [ | ||
{ | ||
"name": "Sort imports", | ||
"command": "isort --diff --check ." | ||
}, | ||
{ | ||
"name": "Flake8", | ||
"command": "flake8 ." | ||
}, | ||
{ | ||
"name": "Format", | ||
"command": "black --diff --check ." | ||
}, | ||
{ | ||
"name": "Typecheck", | ||
"command": "mypy ." | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ery-provider/integration_tests/tasks/entity_manager/test_social_feature_entity_manager.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/discovery-provider/integration_tests/tasks/test_index_profile_challenge_backfill.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.