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

fix(dbt Cloud): allow passing job ID #264

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Conversation

betodealmeida
Copy link
Member

In b09de649 we changed the way the dbt Cloud job is retrieved, since we need more information than just the ID. In order to get the job information we need the account and the project ID, so it became impossible to run the CLI to sync dbt Cloud without being prompted — there's currently no way to pass an account or a project ID to the command.

With this PR we can now do:

$ preset-cli \
> --workspaces=https://example.app.preset.io/ \
> superset sync dbt-cloud \
> ${DBT_TOKEN} ${ACCOUNT_ID} ${PROJECT_ID} ${JOB_ID}

In order to run the sync under CI/CD.

Additionally, when running the script interactively, it will print the IDs:

$ preset-cli superset sync dbt-cloud ${DBT_TOKEN}
Choose one or more workspaces (eg: 1-3,5,8-):

# Preset Internal #
✅ (1) The Data Lab
> 1
https://example.app.preset.io/

Using account My Account [id=123] since it's the only one

Choose a project:
(1) Analytics [id=45]
(2) MetricFlow test [id=67]
> 2

Choose a job:
(1) Parse [id=12345]
(2) Build [id=67890]
> 2

@Vitor-Avila Vitor-Avila self-requested a review February 28, 2024 18:24
Copy link
Contributor

@Vitor-Avila Vitor-Avila left a comment

Choose a reason for hiding this comment

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

Awesome!

@betodealmeida betodealmeida merged commit 235ebf6 into main Feb 28, 2024
4 checks passed
@betodealmeida betodealmeida deleted the dbt-cloud-parameters branch February 28, 2024 18:29
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.

2 participants