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

supports adding DltResource in RESTAPIConfig dict #1865

Conversation

willi-mueller
Copy link
Collaborator

@willi-mueller willi-mueller commented Sep 24, 2024

Description

Related Issues

TODO before merging

  • write documentation
  • discuss: some kind of error message in case people implement a resource returning Generator[dict[str, Any]] instead of `Generator[list[dict[str, Any]]]? Or is documentation enough?

Crashes: process_parent_data_item because item is a str instead of Dict[str, Any]:

 def repositories():
        """A seed list of repositories to fetch"""
        yield from [{"name": "dlt"}, {"name": "verified-sources"}, {"name": "dlthub-education"}]

Correct:

 def repositories():
        """A seed list of repositories to fetch"""
        yield [{"name": "dlt"}, {"name": "verified-sources"}, {"name": "dlthub-education"}]

Also correct:

def repositories():
    """A seed list of repositories to fetch"""
    yield [
        [{"name": "dlt"}],
        [{"name": "verified-sources"}],
        [{"name": "dlthub-education"}],
    ]

@willi-mueller willi-mueller linked an issue Sep 24, 2024 that may be closed by this pull request
Copy link

netlify bot commented Sep 24, 2024

Deploy Preview for dlt-hub-docs ready!

Name Link
🔨 Latest commit f37ffa4
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/66f2d987d489f60008d5792f
😎 Deploy Preview https://deploy-preview-1865--dlt-hub-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@willi-mueller willi-mueller marked this pull request as ready for review September 24, 2024 14:44
Copy link
Collaborator

@burnash burnash left a comment

Choose a reason for hiding this comment

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

Awesome work, @willi-mueller, thank you!

@willi-mueller willi-mueller self-assigned this Sep 25, 2024
@willi-mueller willi-mueller merged commit d9e9dea into devel Sep 25, 2024
62 checks passed
@willi-mueller willi-mueller deleted the feat/1837-rest_api-accept-dltresource-instances-in-resource-list branch September 25, 2024 11:44
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.

rest_api: accept DltResource instances in resource list
2 participants