Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes column order and add hints table variants #1127

Merged
merged 3 commits into from
Mar 24, 2024

Conversation

rudolfix
Copy link
Collaborator

Description

  1. fixes Column hints break column order #1111
  2. fixes allow dynamic table names for items yielded with with_hints #1105

docs tbd.

creation hints variant per table happens as follows:

def test_mark_hints_with_variant() -> None:
    @dlt.resource
    def with_table_hints():
        # create variant for table a,  item dispatch to table a
        yield dlt.mark.with_hints(
            {"id": 1, "pk": "A"},
            dlt.mark.make_hints(
                table_name="table_a", columns=[{"name": "id", "data_type": "bigint"}]
            ),
            create_table_variant=True,
        )
     # then you can dispatch subsequent items like
     yield dlt.mark.with_table_name({"id": 4, "pk": "D"}, "table_a")

@rudolfix rudolfix self-assigned this Mar 21, 2024
Copy link

netlify bot commented Mar 21, 2024

Deploy Preview for dlt-hub-docs canceled.

Name Link
🔨 Latest commit 409abae
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/65ff52bdd91cb400089b12d7

Copy link
Collaborator

@jorritsandbrink jorritsandbrink left a comment

Choose a reason for hiding this comment

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

Besides two minor comments, LGTM!

dlt/extract/hints.py Outdated Show resolved Hide resolved
dlt/extract/items.py Outdated Show resolved Hide resolved
@rudolfix rudolfix marked this pull request as ready for review March 24, 2024 08:51
@rudolfix rudolfix merged commit c975ef4 into devel Mar 24, 2024
47 of 53 checks passed
@rudolfix rudolfix deleted the rfix/fixes-column-order-hints-variants branch March 24, 2024 08:51
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.

Column hints break column order allow dynamic table names for items yielded with with_hints
2 participants