Last active
June 26, 2024 21:00
-
-
Save tashrifbillah/f8451473a78b639e828c42fe419d029c to your computer and use it in GitHub Desktop.
Reorder charts on DPdash
This file contains hidden or 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
#!/usr/bin/env python | |
import json | |
reordered='/data/predict1/charts1.json' | |
raw='/data/predict1/predict-mongodb-backup/charts_20240612.json' | |
# find out the private charts in raw | |
# print 0-indexed indices of private charts from raw file | |
with open(reordered) as f: | |
charts=f.read().strip().split('\n') | |
reordered=[] | |
for c in charts | |
reordered.append(json.loads(c)) | |
with open(raw) as f: | |
charts=f.read().strip().split('\n') | |
raw=[] | |
for c in charts | |
raw.append(json.loads(c)) | |
# iterate through reordered | |
# look for (title,owner) pair in raw | |
# if it does not exist, print index | |
# Dheshan will complete this code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the completed code here: