Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the download token check error #1577

Merged
merged 1 commit into from Jul 6, 2023
Merged

Conversation

m3ngyang
Copy link
Contributor

@m3ngyang m3ngyang commented Jul 2, 2023

Fix the download token checking error.

Description

qlib git:(main) ▶ python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/us_data --region us
Traceback (most recent call last):
  File "scripts/get_data.py", line 9, in <module>
    fire.Fire(GetData)
  File "/home/ubuntu/work/miniconda3/envs/qlib/lib/python3.8/site-packages/fire/core.py", line 138, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/home/ubuntu/work/miniconda3/envs/qlib/lib/python3.8/site-packages/fire/core.py", line 463, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/home/ubuntu/work/miniconda3/envs/qlib/lib/python3.8/site-packages/fire/core.py", line 672, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/home/ubuntu/work/miniconda3/envs/qlib/lib/python3.8/site-packages/qlib/tests/data.py", line 189, in qlib_data
    if not self.check_dataset(file_name):
  File "/home/ubuntu/work/miniconda3/envs/qlib/lib/python3.8/site-packages/qlib/tests/data.py", line 94, in check_dataset
    url = self.merge_remote_url(file_name)
  File "/home/ubuntu/work/miniconda3/envs/qlib/lib/python3.8/site-packages/qlib/tests/data.py", line 37, in merge_remote_url
    token = fernet.decrypt(self.TOKEN).decode()
  File "/home/ubuntu/work/miniconda3/envs/qlib/lib/python3.8/site-packages/cryptography/fernet.py", line 75, in decrypt
    timestamp, data = Fernet._get_unverified_token_data(token)
  File "/home/ubuntu/work/miniconda3/envs/qlib/lib/python3.8/site-packages/cryptography/fernet.py", line 94, in _get_unverified_token_data
    utils._check_bytes("token", token)
  File "/home/ubuntu/work/miniconda3/envs/qlib/lib/python3.8/site-packages/cryptography/utils.py", line 29, in _check_bytes
    raise TypeError("{} must be bytes".format(name))
TypeError: token must be bytes

Motivation and Context

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
image 2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

@github-actions github-actions bot added the waiting for triage Cannot auto-triage, wait for triage. label Jul 2, 2023
@m3ngyang
Copy link
Contributor Author

m3ngyang commented Jul 5, 2023

@you-n-g hi, please help review his change when your avaiable. thx.

@you-n-g you-n-g merged commit 3e074c8 into microsoft:main Jul 6, 2023
32 checks passed
@m3ngyang m3ngyang deleted the fix_download branch July 6, 2023 14:09
@you-n-g you-n-g added bug Something isn't working and removed waiting for triage Cannot auto-triage, wait for triage. labels Jul 18, 2023
PaleNeutron pushed a commit to PaleNeutron/qlib that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants