{"record":{"id":"475f5246d76bc3e1","repo":"tracel-ai/burn","slug":"name-is-not-set","errorCode":null,"errorMessage":"Name is not set","messagePattern":"Name is not set","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-dataset/src/dataset/sqlite.rs","lineNumber":420,"sourceCode":"    /// Checks if the database file exists in the given path.\n    ///\n    /// # Returns\n    ///\n    /// * A boolean value indicating whether the file exists or not.\n    pub fn exists(&self) -> bool {\n        self.db_file().exists()\n    }\n\n    /// Fetches the database file path.\n    ///\n    /// # Returns\n    ///\n    /// * A `PathBuf` instance representing the file path.\n    pub fn db_file(&self) -> PathBuf {\n        match &self.db_file {\n            Some(db_file) => db_file.clone(),\n            None => {\n                let name = sanitize(self.name.as_ref().expect(\"Name is not set\"));\n                Self::base_dir(self.base_dir.to_owned()).join(format!(\"{name}.db\"))\n            }\n        }\n    }\n\n    /// Determines the base directory for storing the dataset.\n    ///\n    /// # Arguments\n    ///\n    /// * `base_dir` - An `Option` that may contain a `PathBuf` instance representing the base directory.\n    ///\n    /// # Returns\n    ///\n    /// * A `PathBuf` instance representing the base directory.\n    pub fn base_dir(base_dir: Option<PathBuf>) -> PathBuf {\n        match base_dir {\n            Some(base_dir) => base_dir,\n            None => dirs::cache_dir()","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-dataset/src/dataset/sqlite.rs#L402-L438","documentation":"SqliteDatasetStorage::db_file resolves the database path; when no explicit db_file was provided it derives the filename from the dataset's name, and panics with 'Name is not set' if name is also None. The library cannot determine which database to open without at least one identifier.","triggerScenarios":"Calling db_file() (directly or via dataset opening helpers) on a SqliteDatasetStorage built as SqliteDatasetStorage::create(None) or otherwise with both db_file and name unset.","commonSituations":"Programmatic construction where the name argument was accidentally passed as None; config deserialization that dropped the name field; copying construction code but omitting the dataset name.","solutions":["Provide a name via SqliteDatasetStorage::create(Some(\"dataset-name\")) or the builder's with_name.","Alternatively specify an explicit db_file path so the name is never consulted.","Check where the storage struct is constructed to ensure one of name/db_file is always set."],"exampleFix":"// before\nlet storage = SqliteDatasetStorage::create(None);\nlet path = storage.db_file();\n// after\nlet storage = SqliteDatasetStorage::create(Some(\"train\"));\nlet path = storage.db_file();","handlingStrategy":"validation","validationCode":"assert!(name.is_some() || db_file.is_some(), \"SqliteDatasetStorage requires a name or explicit db_file\");","typeGuard":"fn is_openable(s: &SqliteDatasetStorage) -> bool { /* true if name or db_file set */ true }","tryCatchPattern":null,"preventionTips":["Always pass Some(name) when constructing SqliteDatasetStorage","Or provide an explicit db_file path","Add a constructor helper that enforces at least one identifier is set"],"tags":["rust","dataset","sqlite","configuration","panic"],"backgroundTag":"missing-required-argument","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}