Skip to content

Commit

Permalink
Return toml document by default
Browse files Browse the repository at this point in the history
  • Loading branch information
amritghimire committed Oct 16, 2024
1 parent b58a3f9 commit 3798325
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/datachain/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def init(datachain_dir: Optional[str] = None):
with open(d.config, "w"):
return Config(d.root)

def load_one(self, level: Optional[str] = None) -> Optional[TOMLDocument]:
def load_one(self, level: Optional[str] = None) -> TOMLDocument:
config_path = DataChainDir(self.get_dir(level)).config

try:
with open(config_path, encoding="utf-8") as f:
return load(f)
except FileNotFoundError:
return None
return TOMLDocument()

def load_config_to_level(self) -> TOMLDocument:
merged_conf = TOMLDocument()
Expand Down Expand Up @@ -81,7 +81,7 @@ def write(self, config: TOMLDocument):
def get_remote_config(self, remote: str = "") -> Mapping[str, str]:
config = self.read()

if config is None:
if not config:
return {"type": "local"}
if not remote:
try:
Expand Down

0 comments on commit 3798325

Please sign in to comment.