Skip to content

Commit 60afd56

Browse files
Fixed crash when database path is relative and nested (#989)
1 parent ab2f1ed commit 60afd56

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
88

99
### Fixed
1010

11-
- config: Forbid extra arguments in config mappings.
12-
- config: Fixed issue with `from` filter being ignored.
1311
- config: Don't raise `ConfigurationError` from some model validators.
12+
- config: Fixed crash when database path is relative and nested.
13+
- config: Fixed issue with `from` filter being ignored.
14+
- config: Forbid extra arguments in config mappings.
1415

1516
## [7.5.3] - 2024-03-28
1617

docs/9.release-notes/_7.5_changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- abi.etherscan: Raise `AbiNotAvailableError` when contract is not verified.
1212
- cli: Fixed incorrect indexer status logging.
1313
- config: Don't raise `ConfigurationError` from some model validators.
14+
- config: Fixed crash when database path is relative and nested.
1415
- config: Fixed issue with `from` filter being ignored.
1516
- config: Forbid extra arguments in config mappings.
1617
- evm.node: Fixed default ratelimit sleep time being too high.

src/dipdup/config/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ def schema_name(self) -> str:
9090

9191
@property
9292
def connection_string(self) -> str:
93+
if self.path != DEFAULT_SQLITE_PATH:
94+
path = Path(self.path).resolve()
95+
path.parent.mkdir(parents=True, exist_ok=True)
96+
return f'{self.kind}:///{path}'
97+
9398
return f'{self.kind}://{self.path}'
9499

95100
@property

0 commit comments

Comments
 (0)