Skip to content

Commit

Permalink
Fix integration test - I misunderstood SQLite URI format
Browse files Browse the repository at this point in the history
  • Loading branch information
jdangerx committed Nov 9, 2023
1 parent 5a4472f commit 67e14b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/pudl/extract/xbrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def xbrl2sqlite(context) -> None:
logger.info(f"Dataset ferc{form}_xbrl is disabled, skipping")
continue

sql_path = Path(urlparse(PudlPaths().sqlite_db(f"ferc{form.value}_xbrl")).path)
sql_path = Path(
urlparse(PudlPaths().sqlite_db(f"ferc{form.value}_xbrl")).path
).resolve()

if sql_path.exists():
if clobber:
Expand Down
4 changes: 3 additions & 1 deletion src/pudl/workspace/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def sqlite_db(self, name: str) -> str:
suffix. E.g. pudl, ferc1 and so on.
"""
db_path = self.output_dir / f"{name}.sqlite"
return f"sqlite://{db_path}"
# SQLite URI has 3 slashes - 2 to separate URI scheme, 1 to separate creds
# sqlite://{credentials}/{db_path}
return f"sqlite:///{db_path}"

def output_file(self, filename: str) -> Path:
"""Path to file in PUDL output directory."""
Expand Down

0 comments on commit 67e14b4

Please sign in to comment.