Skip to content

[DOP-36098] Create LineageBuilder class for fixtures#435

Open
TiGrib wants to merge 3 commits intodevelopfrom
feature/DOP-36098
Open

[DOP-36098] Create LineageBuilder class for fixtures#435
TiGrib wants to merge 3 commits intodevelopfrom
feature/DOP-36098

Conversation

@TiGrib
Copy link
Copy Markdown
Contributor

@TiGrib TiGrib commented Apr 9, 2026

Change Summary

Add low level class LineageBuilder. It's responsibility to create base entities.
My proposal for next step is add higher level helper-functions like:

  • job_stack() -> create a job with run and operation
  • io() -> create input - operation - output
    and others ...

Related issue number

[DOP-36098]

Checklist

  • Commit message and PR title is comprehensive
  • Keep the change as small as possible
  • Unit and integration tests for the changes exist
  • Tests pass on CI and coverage does not decrease
  • Documentation reflects the changes where applicable
  • docs/changelog/next_release/<pull request or issue id>.<change type>.rst file added describing change
    (see CONTRIBUTING.rst for details.)
  • My PR is ready to review.

@TiGrib TiGrib requested a review from dolfinus April 9, 2026 15:15
@TiGrib TiGrib self-assigned this Apr 9, 2026
@TiGrib TiGrib added the ci:skip-changelog Add this label to skip changelog file check label Apr 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Coverage

Coverage Report •
FileStmtsMissBranchBrPartCoverMissing
TOTAL7995995126022187% 
report-only-changed-files is enabled. No files were changed during this commit :)

builder = LineageBuilder(async_session)
job_location = await builder.create_location(key="simple_lineage_job_location")
job_type = await builder.create_job_type(key="simple_lineage_job_type")
job = await builder.create_job(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lineage tests are not using location at all, so it can be generated for each job, and nothing should happen. Just an idea

self.column_relations: dict[str, DatasetColumnRelation] = {}

# Optional reverse index useful for debugging and ad-hoc assertions.
self.by_id: dict[str, object] = {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Key should include object type. Without this information it is impossible to tell apart job.id = 1; by_id[job.id] from dataset.id = 1; by_id[dataset.id]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Right now I'm think that it's not best realization and maybe it's better to rewright all test fixtures using by_key implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:skip-changelog Add this label to skip changelog file check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants