Skip to content

Conversation

@zilto
Copy link
Collaborator

@zilto zilto commented Aug 8, 2025

Related

Features:

  • top-level dlt.dataset()
  • avoid conflicts between module dlt.dataset and function dlt.dataset() by naming module dlt._dataset instead.
    • AFAIU, this should be done in a follow-up PR
  • public names dlt.Relation (at dlt.dataset.relation::Relation) and dlt.Dataset (at dlt.dataset.dataset::Dataset)
  • Rename protocols dlt.Relation (at dlt.common.destination.dataset::Dataset) to dlt.common.destination.dataset::SupportsDataset (removed top-level); same for dlt.Dataset -> SupportsDataset
  • backwards compatible APIs by pointing old imports to new ones
  • deprecation warnings on type checking

Context

It does many useful things:

  • top level dlt.dataset() to create / access datasets
  • top-level module _dataset
  • private module _dataset to avoid leaking interfaces
  • sets public names to dlt.Relation and dlt.Dataset instead of dlt.destinations.dataset.relation.ReadableDBAPIRelation and dlt.destinations.dataset.dataset.ReadableDBAPIDataset
  • fix typing issues (cast(), # type: ignore)
    I get that removing dlt.Dataset(Protocol) and dlt.Relation(Protocol) is controversial. I can add them back as SupportsDataset(Protocol) and SupportsRelation(Protocol).
    So if I start a new branch where the same changes are made but:
  • call it dlt.dataset instead of dlt._dataset
  • keep the protocols as SupportsDataset and SupportsRelation
  • use git mv
    • I don't know if this will work, given the files still exist
      There will be no blockers?

@netlify
Copy link

netlify bot commented Aug 8, 2025

Deploy Preview for dlt-hub-docs canceled.

Name Link
🔨 Latest commit a839db1
🔍 Latest deploy log https://app.netlify.com/projects/dlt-hub-docs/deploys/689a31df161d9a0007b5b673

@zilto
Copy link
Collaborator Author

zilto commented Aug 8, 2025

Closing because git mv doesn't improve GitHub diff view

@zilto zilto closed this Aug 8, 2025
@zilto zilto reopened this Aug 9, 2025
@zilto zilto self-assigned this Aug 11, 2025
@zilto zilto requested review from rudolfix and sh-rp August 11, 2025 18:19
@zilto zilto added the enhancement New feature or request label Aug 11, 2025
@zilto zilto marked this pull request as ready for review August 11, 2025 18:20
Copy link
Collaborator

@rudolfix rudolfix left a comment

Choose a reason for hiding this comment

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

this LGTM and we can merge. there's one question before we do it:

now the typing user sees is SupportsRelation, not Relation. same for Dataset.

in case of other top level objects: Pipeline, Destination (this is generic and typically a concrete type is seen) DltResourceandDltSource`

should we clean that up? I think we can do that in backward compatible way. I prefer simple names like Relation or Pipeline.

@zilto zilto merged commit 518e71c into devel Aug 13, 2025
61 checks passed
@zilto zilto deleted the fix/top-level-relation branch August 13, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants