Skip to content

Commit

Permalink
dlt patch update (fixing MotherDuck version bump). Patch updates of d…
Browse files Browse the repository at this point in the history
…ependencies.
  • Loading branch information
Erik Oosterop committed Oct 17, 2023
1 parent ab33a63 commit 1f61579
Show file tree
Hide file tree
Showing 6 changed files with 1,203 additions and 735 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Custom
*.duckdb
gas_storage.duckdb
r2.py
src/mimosa/r2.py

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
<!-- insertion marker -->
## [Unreleased]

## [0.2.0] 2023-09-26
## [0.2.1] 2023-10-17

### Changed
- Version/patch bump for dlt, fixing MotherDuck/DuckDB destination (v0.9.1)

## [0.2.0] 2023-10-16

### Changed
- Use duckdb version >=0.9.1
Expand Down
1,910 changes: 1,179 additions & 731 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ disallow_incomplete_defs = true

[tool.poetry]
name = "ternyxmimosa"
version = "0.2.0"
version = "0.2.1"
description = "A minimal modern data stack with working data pipelines in a single Docker container."
authors = ["Erik Oosterop <[email protected]>"]
license = "MIT"
Expand All @@ -31,7 +31,7 @@ packages = [ { include = "mimosa", from = "src" } ]

[tool.poetry.dependencies]
python = "^3.11"
dlt = {extras = ["motherduck"], version = "^0.3.17"}
dlt = {extras = ["cli", "filesystem", "motherduck"], version = "^0.3.21"}
python-dotenv = "^1.0.0"
loguru = "^0.7.2"
pandas = "2.0.3"
Expand Down
8 changes: 8 additions & 0 deletions src/mimosa/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ def __init__(self, destination="motherduck"):
msg = "MotherDuck credentials missing. Set in environment variable DESTINATION__MOTHERDUCK__CREDENTIALS."
raise MissingEnvironmentVariableError(msg) from e

if self.destination == "filesystem___XXX":
# TODO: Potentiall remove. Is here to try Cloudlfare R2, but that is not working yet.
try:
_ = os.environ["DESTINATION__FILESYSTEM__BUCKET_URL"]
except KeyError as e:
msg = "Filesystem bucket url missing. Set in environment variable DESTINATION__FILESYSTEM__BUCKET_URL."
raise MissingEnvironmentVariableError(msg) from e

@dlt.resource(
primary_key=("gasDayStart", "code"),
table_name="storage",
Expand Down
7 changes: 6 additions & 1 deletion src/mimosa/wip.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@
if run_this:
pipeline.run_landing_pipeline(
gas_date=date(2023, 9, 27), # still from 2019-01-01 to 2019-09-01
to_gas_date=date(2023, 10, 1),
to_gas_date=date(2023, 9, 28),
reporting_update=reporting_update,
)
"""
pipeline.run_landing_pipeline(
reporting_update=reporting_update,
)
"""
else:
pipeline.run_landing_pipeline()

Expand Down

0 comments on commit 1f61579

Please sign in to comment.