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

Example click API usage #6307

Merged
merged 9 commits into from
Jan 3, 2023
Merged

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Nov 23, 2022

resolves #6310
resolves #6099

Description

This PR introduces a script that will serve as a base to be iterated on as we work through API-ification so that it serves as a live spec of the API-ified effort. Currently implemented with deps but ideally swapped out with run as soon as that is available in the click API.

Open Question(s)

  • Currently dbt is callable programmatically by constructing a click Context and invoking the relevant command. Should we provide a thin abstraction over this so callers don't need to be concerned with the details + extra dependency management of click?

Checklist

@cla-bot cla-bot bot added the cla:yes label Nov 23, 2022
@MichelleArk MichelleArk changed the base branch from main to feature/click-cli November 23, 2022 01:25
core/dbt/cli/example.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@MichelleArk MichelleArk force-pushed the arky/example-dbt-client branch from 055fded to 69d9b04 Compare November 23, 2022 17:57
@MichelleArk MichelleArk added the Skip Changelog Skips GHA to check for changelog file label Nov 23, 2022
@MichelleArk MichelleArk marked this pull request as ready for review November 23, 2022 22:12
@MichelleArk MichelleArk requested a review from a team as a code owner November 23, 2022 22:12
dbt_cli.commands[command].invoke(ctx)


For the full code example, you can refer to `example.py <https://github.com/dbt-labs/dbt-core/blob/feature/click-cli/core/dbt/cli/example.py>`_
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure what would be a more clear way of add this type of link to a file that doesn't exists yet, or always keep it up to date

@ChenyuLInx
Copy link
Contributor

@MichelleArk I thinking of directly using this PR for #6099, hope you don't mind!
@iknox-fa @stu-k this is ready for review

@ChenyuLInx ChenyuLInx requested review from ChenyuLInx and stu-k and removed request for gshank and colin-rogers-dbt December 7, 2022 00:36
@ChenyuLInx ChenyuLInx requested a review from stu-k December 22, 2022 07:04
@ChenyuLInx
Copy link
Contributor

@iknox-fa this is updated with latest interface, and ready to review

Copy link
Contributor

@iknox-fa iknox-fa left a comment

Choose a reason for hiding this comment

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

LGTM

core/dbt/cli/example.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants