Skip to content

Commit

Permalink
Safely access possibly missing dictionary key
Browse files Browse the repository at this point in the history
This changes a logging output to get a default value if the desired key is
absent.
  • Loading branch information
mcdonnnj committed Sep 29, 2021
1 parent 9c9fe89 commit 2b81477
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lineage/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def main() -> None:
remote_branch: Optional[str]
remote_url: str
if config.get("version") != "1":
logging.warning(f"Incompatible config version: {config['version']}")
logging.warning(f"Incompatible config version: {config.get('version')}")
continue
if "lineage" not in config:
logging.warning("Could not find 'lineage' key in config.")
Expand Down

0 comments on commit 2b81477

Please sign in to comment.