{"record":{"id":"e6ce8d602beecf46","repo":"microsoft/qlib","slug":"not-support-type-file-or-data","errorCode":null,"errorMessage":"not support {type(file_or_data)}","messagePattern":"not support (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scripts/dump_bin.py","lineNumber":284,"sourceCode":"                    np.array(_df[field]).astype(\"<f\").tofile(fp)\n            else:\n                # append; self._mode == self.ALL_MODE or not bin_path.exists()\n                np.hstack([date_index, _df[field]]).astype(\"<f\").tofile(str(bin_path.resolve()))\n\n    def _dump_bin(self, file_or_data: [Path, pd.DataFrame], calendar_list: List[pd.Timestamp]):\n        if not calendar_list:\n            logger.warning(\"calendar_list is empty\")\n            return\n        if isinstance(file_or_data, pd.DataFrame):\n            if file_or_data.empty:\n                return\n            code = fname_to_code(str(file_or_data.iloc[0][self.symbol_field_name]).lower())\n            df = file_or_data\n        elif isinstance(file_or_data, Path):\n            code = self.get_symbol_from_file(file_or_data)\n            df = self._get_source_data(file_or_data)\n        else:\n            raise ValueError(f\"not support {type(file_or_data)}\")\n        if df is None or df.empty:\n            logger.warning(f\"{code} data is None or empty\")\n            return\n\n        # try to remove dup rows or it will cause exception when reindex.\n        df = df.drop_duplicates(self.date_field_name)\n\n        # features save dir\n        features_dir = self._features_dir.joinpath(code_to_fname(code).lower())\n        features_dir.mkdir(parents=True, exist_ok=True)\n        self._data_to_bin(df, calendar_list, features_dir)\n\n    @abc.abstractmethod\n    def dump(self):\n        raise NotImplementedError(\"dump not implemented!\")\n\n    def __call__(self, *args, **kwargs):\n        self.dump()","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/scripts/dump_bin.py#L266-L302","documentation":"Error \"not support {type(file_or_data)}\" thrown in microsoft/qlib.","triggerScenarios":"This error is raised at scripts/dump_bin.py:284 when the guard condition fails: \"not support {type(file_or_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 a supported type (file path or DataFrame) to the dump function.","Convert your input to a pd.DataFrame or a supported file path before calling."],"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-15T22:17:37.221Z"}