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

Add example to demonstrate a job with condition task #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pietern
Copy link
Contributor

@pietern pietern commented Feb 7, 2024

No description provided.

Copy link
Contributor

@lennartkats-db lennartkats-db left a comment

Choose a reason for hiding this comment

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

👍 I really like having a conditional example here! I would show something with a task value though. Writing notebook code with a task value is the most complicated part of making a conditional work.

tasks:
- task_key: condition
condition_task:
left: "{{ job.parameters.[run_sql_task] }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we show an example with a task value instead? So we have one Python notebook compute something, return it, and then use it in the conditional?

(Btw we want to support that use case for SQL queries too but don't have that support yet.)

The current example using a job parameter is a bit atypical.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could that be an additional example? For this one, I wanted to repro an issue and capture the example.

Copy link

@gaborratky-db gaborratky-db Feb 7, 2024

Choose a reason for hiding this comment

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

We could have a notebook "process_data" that does some data processing and sets a task value "optimize" that determines whether to run OPTIMIZE <table> in a subsequent SQL query task:

if {{ tasks.process_data.values.optimize }} == "true" => OPTIMIZE <table>

and do nothing if false

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.

3 participants