-
Notifications
You must be signed in to change notification settings - Fork 978
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 batch property to model jinja fnction #6590
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| Property | Description | Example | | ||
| -------- | ----------- | ------- | | ||
| `id` | The unique identifier for the batch within the context of the microbatch model. | `model.batch.id` | | ||
| `event_time_start` | The start time of the batch's [`event_time`](/reference/resource-configs/event-time) filter (inclusive). | `model.batch.event_time_start` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@QMalcolm what do we mean by 'inclusive' and 'exclusive' here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirnawong1 great question ❤️
Short answer
Inclusive means the value is included in the batch, exclusive means the value is excluded from the batch
Long answer
To think specifically about inclusivity/exclusivity means with regard to a batch, consider the batch filter statement
WHERE event_time >= event_time_start AND event_time < event_time_end
Things to note
- The comparison of
event_time
toevent_time_start
used>=
with the=
part of the operator including theevent_time_start
as part of the range. This means the usage ofevent_time_start
is inclusive in the range selection - In the comparison of
event_time
toevent_time_end
we used<
meaning things up to, but not equal to, theevent_time_end
will be selected as part of the range. This means thatevent_time_end
is exclusive in the range selection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh got it, thanks so much for taking the time to clarify 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
|
||
### Usage notes | ||
|
||
`model.batch` is only available during the execution of a microbatch model batch. Outside of the microbatch execution, `model.batch` is `None`, and its sub-properties aren't accessible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We sort of state this above. Maybe we could combine the two into a callout if it's important enough
Co-authored-by: Matt Shaver <[email protected]>
Co-authored-by: Matt Shaver <[email protected]>
Co-authored-by: Matt Shaver <[email protected]>
Co-authored-by: Matt Shaver <[email protected]>
Check your created Crawler Check your created index on your Algolia Application |
this pr adds a new
batch
object to the already existing model dbt-jinja-functions.The batch qualities available are:
id (i.e. model.batch.id)
This is the "unique" id for the batch within the context of the microbatch model
event_time_start (i.e. model.batch.event_time_start)
This is the start time of the batch's event time filter (inclusive)
event_time_end (i.e. model.batch.event_time_end)
This is the end time of the batch's event_time_filter (exclusive
Resolves #6585
🚀 Deployment available! Here are the direct links to the updated files: