Skip to content

feat: write database_dependencies to datapackage metadata (v4.7)#265

Merged
cmutel merged 1 commit into
mainfrom
feat/database-dependencies
May 13, 2026
Merged

feat: write database_dependencies to datapackage metadata (v4.7)#265
cmutel merged 1 commit into
mainfrom
feat/database-dependencies

Conversation

@cmutel
Copy link
Copy Markdown
Member

@cmutel cmutel commented May 13, 2026

Summary

  • Database.process() now writes dp.metadata["database_dependencies"] = sorted(dependents) into the datapackage before finalize_serialization(), so downstream consumers can inspect which databases a datapackage depends on without re-scanning exchanges
  • The dependents set is already computed during exchange iteration — this change only surfaces it into the datapackage file (the existing self.metadata["depends"] entry is unchanged)
  • New automatic migration "4.7 database dependencies in datapackage" reprocesses all databases so existing datapackages gain the new field
  • Version bumped to 4.7

Test plan

  • test_process_writes_database_dependencies_to_datapackage — writes two databases with a cross-database technosphere exchange and asserts package.metadata["database_dependencies"] == ["other database"]
  • test_process_writes_empty_database_dependencies_when_no_external_inputs — self-contained database asserts package.metadata["database_dependencies"] == []

Add dp.metadata["database_dependencies"] = sorted(dependents) in
Database.process() before finalize_serialization(), so the datapackage
itself carries the list of databases it depends on. The dependents set
is already computed during exchange iteration; this just surfaces it
into the datapackage file alongside the existing self.metadata["depends"].

Add migration "4.7 database dependencies in datapackage" that reprocesses
all databases so existing datapackages gain the new metadata field.

Bump version to 4.7.
@cmutel cmutel merged commit efb291d into main May 13, 2026
9 checks passed
@cmutel cmutel deleted the feat/database-dependencies branch May 13, 2026 08:39
@cmutel cmutel mentioned this pull request May 13, 2026
2 tasks
@cmutel cmutel self-assigned this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant