{"record":{"id":"627b41c8a4e25b02","repo":"microsoft/qlib","slug":"if-normalize-1min-the-qlib-data-1d-dir-parameter","errorCode":null,"errorMessage":"If normalize 1min, the qlib_data_1d_dir parameter must be set: --qlib_data_1d_dir <user qlib 1d data >, Reference: https://github.com/microsoft/qlib/tree/main/scripts/data_collector/yahoo#automatic-update-of-daily-frequency-datafrom-yahoo-finance","messagePattern":"If normalize 1min, the qlib_data_1d_dir parameter must be set: --qlib_data_1d_dir <user qlib 1d data >, Reference: https://github\\.com/microsoft/qlib/tree/main/scripts/data_collector/yahoo#automatic-update-of-daily-frequency-datafrom-yahoo-finance","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scripts/data_collector/yahoo/collector.py","lineNumber":833,"sourceCode":"        end_date: str\n            if not None, normalize the last date saved (including end_date); if None, it will ignore this parameter; by default None\n        qlib_data_1d_dir: str\n            if interval==1min, qlib_data_1d_dir cannot be None, normalize 1min needs to use 1d data;\n\n                qlib_data_1d can be obtained like this:\n                    $ python scripts/get_data.py qlib_data --target_dir <qlib_data_1d_dir> --interval 1d\n                    $ python scripts/data_collector/yahoo/collector.py update_data_to_bin --qlib_data_1d_dir <qlib_data_1d_dir> --trading_date 2021-06-01\n                or:\n                    download 1d data, reference: https://github.com/microsoft/qlib/tree/main/scripts/data_collector/yahoo#1d-from-yahoo\n\n        Examples\n        ---------\n            $ python collector.py normalize_data --source_dir ~/.qlib/stock_data/source --normalize_dir ~/.qlib/stock_data/normalize --region cn --interval 1d\n            $ python collector.py normalize_data --qlib_data_1d_dir ~/.qlib/qlib_data/cn_data --source_dir ~/.qlib/stock_data/source_cn_1min --normalize_dir ~/.qlib/stock_data/normalize_cn_1min --region CN --interval 1min\n        \"\"\"\n        if self.interval.lower() == \"1min\":\n            if qlib_data_1d_dir is None or not Path(qlib_data_1d_dir).expanduser().exists():\n                raise ValueError(\n                    \"If normalize 1min, the qlib_data_1d_dir parameter must be set: --qlib_data_1d_dir <user qlib 1d data >, Reference: https://github.com/microsoft/qlib/tree/main/scripts/data_collector/yahoo#automatic-update-of-daily-frequency-datafrom-yahoo-finance\"\n                )\n        super(Run, self).normalize_data(\n            date_field_name, symbol_field_name, end_date=end_date, qlib_data_1d_dir=qlib_data_1d_dir\n        )\n\n    def normalize_data_1d_extend(\n        self, old_qlib_data_dir, date_field_name: str = \"date\", symbol_field_name: str = \"symbol\"\n    ):\n        \"\"\"normalize data extend; extending yahoo qlib data(from: https://github.com/microsoft/qlib/tree/main/scripts#download-cn-data)\n\n        Notes\n        -----\n            Steps to extend yahoo qlib data:\n\n                1. download qlib data: https://github.com/microsoft/qlib/tree/main/scripts#download-cn-data; save to <dir1>\n\n                2. collector source data: https://github.com/microsoft/qlib/tree/main/scripts/data_collector/yahoo#collector-data; save to <dir2>","sourceCodeStart":815,"sourceCodeEnd":851,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/scripts/data_collector/yahoo/collector.py#L815-L851","documentation":"Error \"If normalize 1min, the qlib_data_1d_dir parameter must be set: --qlib_data_1d_dir <user qlib 1d data >, Reference: https://github.com/microsoft/qlib/tree/main/scripts/data_collector/yahoo#automatic-update-of-daily-frequency-datafrom-yahoo-finance\" thrown in microsoft/qlib.","triggerScenarios":"This error is raised at scripts/data_collector/yahoo/collector.py:833 when the guard condition fails: \"qlib_data_1d_dir parameter must be set when normalizing 1min data\". It triggers when the code path receives input or a state that violates the precondition checked at this point — e.g. an unimplemented abstract method being called, an unsupported argument type/value, or an invalid configuration. To avoid it, satisfy the documented precondition before this call: implement the required method in your subclass, or pass a supported value of the expected type as described by the message.","commonSituations":"See trigger scenarios.","solutions":["Pass --qlib_data_1d_dir pointing to your qlib daily data directory when normalizing 1min data.","Run without 1min normalization if you do not have daily qlib data."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}