Description
The script python/download-futures-markPriceKlines.py fails to respect the -skip-monthly and -skip-daily arguments, resulting in unconditional downloads of both data types regardless of user input.
Root Cause Analysis (Historical Context)
This bug was introduced in Commit df27179 (View Commit) on May 23, 2022.
In that commit:
- The flags
-skip-monthly and -skip-daily were correctly added to the shared argument parser in python/utility.py.
- The logic to respect these flags was correctly implemented in
python/download-kline.py.
- However, for the newly created
python/download-futures-markPriceKlines.py, while the parser inherited these flags, the conditional logic to check them was omitted. The script calls download_daily_markPriceKlines unconditionally at the end of execution.
Steps to Reproduce
Run the script attempting to skip daily data:
python python/download-futures-markPriceKlines.py -t um -s BTCUSDT -skip-daily 1
Observed Result:
The script proceeds to download daily data files, ignoring the flag.
Expected Result:
The script should skip the daily data download phase, consistent with the behavior of download-kline.py.
Proposed Fix
Add conditional checks for args.skip_monthly and args.skip_daily before invoking the respective download functions.
Description
The script
python/download-futures-markPriceKlines.pyfails to respect the-skip-monthlyand-skip-dailyarguments, resulting in unconditional downloads of both data types regardless of user input.Root Cause Analysis (Historical Context)
This bug was introduced in Commit
df27179(View Commit) on May 23, 2022.In that commit:
-skip-monthlyand-skip-dailywere correctly added to the shared argument parser inpython/utility.py.python/download-kline.py.python/download-futures-markPriceKlines.py, while the parser inherited these flags, the conditional logic to check them was omitted. The script callsdownload_daily_markPriceKlinesunconditionally at the end of execution.Steps to Reproduce
Run the script attempting to skip daily data:
Observed Result:
The script proceeds to download daily data files, ignoring the flag.
Expected Result:
The script should skip the daily data download phase, consistent with the behavior of
download-kline.py.Proposed Fix
Add conditional checks for
args.skip_monthlyandargs.skip_dailybefore invoking the respective download functions.